Closed kimhemsoe closed 12 years ago
Had GitGub notifications off and missed your comment, sorry. I'll look into this after I fix the translation tests.
None of them is really great
True.
Just sent an email to the smarty-discussion ml to hopefully get more suggestions (it was not approved by the moderators yet).
From the options you suggested I'm a little biased towards the modifier option. In the meantime I'm writing some code to support a SecurityExtension until we reach a decision.
SecurityExtension is now available in the security-extension branch, if you want to try it. I'll merge it to master soon nevertheless.
Looks good, more or less the same ive added to our custom smarty extensions inside our app bundle. Except ive never added support for other then the role tho
Just merged security-extension into main branch. A modifier is currently used. I'm closing this issue, if you see problems using the extension just re-open it.
Lets discuss how the plugins should look like
Suggestions to start from:
{if {is_granted role='IS_AUTHENTICATED_FULLY'}} // easy to understand but the extra {} is ugly. Params: role, roles, object, field
{if 'IS_AUTHENTICATED_FULLY'|is_granted} not great with $object and $field
$app also works ofc {if $app->getSecurity()->isGranted('IS_AUTHENTICATED_FULLY')}
None of them is really great
What do you think ?