You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jc...@apache.org on 2014/04/08 13:50:22 UTC

git commit: ISIS-765: Allow regular expressions to match user roles

Repository: isis
Updated Branches:
  refs/heads/master d29680409 -> bc621d0e9


ISIS-765: Allow regular expressions to match user roles


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/bc621d0e
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/bc621d0e
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/bc621d0e

Branch: refs/heads/master
Commit: bc621d0e9b321f9bef9dccc6c4907f078bc10ce4
Parents: d296804
Author: unknown <jv...@ams-7-nl19.ECP.LOC>
Authored: Tue Apr 8 13:24:48 2014 +0200
Committer: unknown <jv...@ams-7-nl19.ECP.LOC>
Committed: Tue Apr 8 13:24:48 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/isis/applib/security/UserMemento.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/bc621d0e/core/applib/src/main/java/org/apache/isis/applib/security/UserMemento.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/security/UserMemento.java b/core/applib/src/main/java/org/apache/isis/applib/security/UserMemento.java
index ccfe1bd..d2dd289 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/security/UserMemento.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/security/UserMemento.java
@@ -105,6 +105,8 @@ public final class UserMemento {
 
     /**
      * Determines if the user fulfills the specified role.
+     *  
+     * @param role  the role to search for, regular expressions are allowed 
      */
     public boolean hasRole(final RoleMemento role) {
         return hasRole(role.getName());
@@ -116,7 +118,7 @@ public final class UserMemento {
      */
     public boolean hasRole(final String roleName) {
         for (final RoleMemento role : roles) {
-            if (role.getName().equals(roleName)) {
+            if (role.getName().matches(roleName)) {
                 return true;
             }
         }