[ 
http://jira.magnolia-cms.com/browse/MGNLSTK-482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26505#action_26505
 ] 

Grégory Joseph commented on MGNLSTK-482:
----------------------------------------

Done on trunk - there is a slight behaviour change, highlighted by 
{{STKUtilTest#testCurrentUserHasOneRoleReturnsTrueIfNoRolesAreRequired}}. 

The previous implementation used to return {{false}} if no role was required 
(the collection passed to the method). It now returns true (if no role is 
required, the user should be allowed)

All usages of this method were surrounded by checks to see if the passed 
collection was not empty, so this change should not have any impact.


> STKUtil.currentUserHasOneRole should not modify the user's role collection
> --------------------------------------------------------------------------
>
>                 Key: MGNLSTK-482
>                 URL: http://jira.magnolia-cms.com/browse/MGNLSTK-482
>             Project: Magnolia Standard Templating Kit
>          Issue Type: Improvement
>          Components: base system
>            Reporter: Zdenek Skodik
>            Assignee: Grégory Joseph
>             Fix For: 1.3
>
>
> currently the {{STKUtil.currentUserHasOneRole}} modifies the {{allRoles}} 
> collection directly which can lead to loss of roles of logged user. We can 
> use the {{CollectionUtils.containsAny(allRoles, roles)}} instead.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to