[Flow] Beginner Questions
Steffen Wickham
steffen at gaming-inc.de
Tue Jan 14 10:44:43 CET 2014
Good morning everybody! :)
Am 14.01.14 09:00, schrieb Jan Herzog:
> Hello Steffen and Bastian,
>
> first of all, im kinda impressed of the ammount of help and response i
> get here. Many Thanks to both of you guys.
welcome! :)
>
> I had the Account register working before, while working arround with
> different code (without using
> $this->persistenceManager->persistAll();), but in my testing i just
> tried some variables set.
>
> Now i think i got Login and Register working (Atleast the Authenticate
> doesnt throw Exceptions). The next thing i tried was using group
> permissions. I was able to Assign a Group to the User
> flow_security_account flow_policy_role
> dfc25328-beb5-7bcf-5bb2-18ab0170a6d4 Administrator
>
> I tried to use the security.ifHasRole. But the Content of it didnt get
> shown. If i wouldnt be using flow, i would just expect me missing
> Sessions. But i would also think, that flow manage those stuff.
>
> <f:security.ifHasRole role="Administrator">
> Admin klappt
> </f:security.ifHasRole>
>
> <f:form controller="login" action="authenticate" method="post"
> class="form-inline">
> <f:form.textfield
> name="__authentication[TYPO3][Flow][Security][Authentication][Token][UsernamePassword][username]"
> placeholder="username"/>
> <f:form.password
> name="__authentication[TYPO3][Flow][Security][Authentication][Token][UsernamePassword][password]"
> placeholder="password"/>
> <f:form.button type="submit">Log in</f:form.button>
> </f:form>
Okay, you solved this by your own (using wrong template name), so I skip
this part.
>
> I need 2 Kinds of permissions. I need something like Global
> permissions, and i need permissions asign to some other controllers
> (im using this in office, so im not allowed to be more specific.. im
> trying to descripe the Problem).
>
> Lets Say i got a Forum. I want some Global permissions, like the
> Administrator. And then i want some Special permssions, like some user
> beeing Moderator for Specific Threads only. But they can be Moderator
> in other Threads too, but are Globaly Users. Is this possible with Flow?
It's kind of "dirty" to achieve it but it is possible, I'd done it by my
own. As I mentioned some time ago on this mailing list, I'm developing a
management tool for american football officials and got several access
layers (= roles). First of all, all registered officials are in the
group "Referees". Then there are Referees which are able to manage
assignments of other referees when they are in the same club, I named it
"RefereeManager" (yeah I know it's not the best name... :-/). On top of
these roles I have a role named "Manager" which is the head of all
officials in the association and can do nearly everything. And then
there is an "Administrator" role, which is allowed to do all stuff, even
deleting critical data. All roles are linked hierachical bottom up.
But it's not atomic enough, because the "RefereeManager" isn't not
allowed to do everything they could do, as some club manager want to
manage their data (address, contact data, logo, and so on) completly or
partly by their own, which normally would be handled by the
RefereeManager. So I added a new "userSettings" property (just an
associative array) to my Referee user model (the derived class from
AbstractParty), where I'm able set several flags for each value which
can be modified. Then I wrote a simple ViewHelper which works like the
<f:security.hasRole/> View Helper of Fluid to negotiate whether the user
will only see plain text or get an input field. It is pretty simple:
Just pass the requested property settings to the ViewHelper then it get
the authenticated user through securityContext, read the userSettings
and check for the requested key and its value. By default the access
will be denied, if you hadn't changed default behaviour wor a property
in my Settings.yaml.
Greetings,
Steffen
More information about the Flow
mailing list