2011/12/6 Brett Porter <[email protected]>:
> Haven't looked yet, but the tech sounds good.
>
> One question:
>
> On 06/12/2011, at 12:40 AM, Olivier Lamy wrote:
>
>>
>> To handle karma on the ui, an attribute must be added in element which
>> need roles.
>> Sample:
>> <li style="display: none" redback-permissions="{permissions:
>> ['archiva-manage-users']}"><a href="#"
>> onclick="displayUsersGrid()">User List</a></li>
>>
>
> How does this work?

Note it can be an array of permissions.
After logging a function get user karma and check all element which
have this attribute. If the user doesn't have at least one of the
needed permissions the html element is hide.

See 
https://fisheye.codehaus.org/browse/redback/redback/trunk/redback-integrations/redback-knockoutjs/redback-knockoutjs-example/src/main/webapp/js/main.js?r=1605&r=1606#to62
 function decorateMenuWithKarma

BTW permissions are checked again on rest call with the annotation
mechanism described here:
http://redback.codehaus.org/integration/rest.html
("PermissionInterceptor" section).

>
> - Brett
>
>
> --
> Brett Porter
> [email protected]
> http://brettporter.wordpress.com/
> http://au.linkedin.com/in/brettporter
>
>
>
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

Reply via email to