User: starksm
Date: 01/06/10 23:23:39
Modified: src/main/org/jboss/security/plugins JaasSecurityManager.java
Log:
Update userHasRole implementation to accept a Set<Principals> rather
than Principal names
Revision Changes Path
1.6 +5 -6
jbosssx/src/main/org/jboss/security/plugins/JaasSecurityManager.java
Index: JaasSecurityManager.java
===================================================================
RCS file:
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/plugins/JaasSecurityManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JaasSecurityManager.java 2001/04/11 02:04:21 1.5
+++ JaasSecurityManager.java 2001/06/11 06:23:39 1.6
@@ -51,7 +51,7 @@
@author <a href="[EMAIL PROTECTED]">Oleg Nitz</a>
@author [EMAIL PROTECTED]
-@version $Revision: 1.5 $
+@version $Revision: 1.6 $
*/
public class JaasSecurityManager implements SubjectSecurityManager, RealmMapping
{
@@ -226,12 +226,12 @@
a member of the Roles group, then the user has the role.
@param principal, ignored. The current authenticated Subject determines
the active user and assigned user roles.
- @param roleNames, a set of String names for the roles to check.
+ @param rolePrincipals, a Set of Principals for the roles to check.
@see java.security.acl.Group;
@see Subject#getPrincipals()
*/
- public boolean doesUserHaveRole(Principal principal, Set roleNames)
+ public boolean doesUserHaveRole(Principal principal, Set rolePrincipals)
{
boolean hasRole = false;
Subject subject = getActiveSubject();
@@ -269,11 +269,10 @@
roles = info.roles;
if( roles != null )
{
- Iterator iter = roleNames.iterator();
+ Iterator iter = rolePrincipals.iterator();
while( hasRole == false && iter.hasNext() )
{
- String name = (String) iter.next();
- SimplePrincipal role = new SimplePrincipal(name);
+ Principal role = (Principal) iter.next();
hasRole = roles.isMember(role);
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development