org.apache.felix.useradmin.impl
Class AuthorizationImpl

java.lang.Object
  extended by org.apache.felix.useradmin.impl.AuthorizationImpl
All Implemented Interfaces:
Authorization

public class AuthorizationImpl
extends Object
implements Authorization

Version:
$Rev$ $Date$
See Also:
Authorization

Constructor Summary
AuthorizationImpl(User user, UserAdminServiceImpl userAdmin)
          Construct new Authorization object with provided user and UserAdmin service implementation.
 
Method Summary
protected  void addWorkingOnRole(Role role)
          Adds working role to working on roles by this Autorization object.
 String getName()
           
 String[] getRoles()
          Looking for all Roles implied by this Authorization object.
 boolean hasRole(String name)
           
protected  boolean isWorkingOnRole(Role role)
          Check if current Autorization object is working on provided role.
protected  void removeWorkingOnRole(Role role)
          Removes working on role.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizationImpl

public AuthorizationImpl(User user,
                         UserAdminServiceImpl userAdmin)

Construct new Authorization object with provided user and UserAdmin service implementation.

Parameters:
user - User for who authorization can be checked
userAdmin - UserAdmin service implementation
Method Detail

getName

public String getName()
Specified by:
getName in interface Authorization
See Also:
Authorization.getName()

getRoles

public String[] getRoles()
Looking for all Roles implied by this Authorization object.

Specified by:
getRoles in interface Authorization
See Also:
Authorization.getRoles()

hasRole

public boolean hasRole(String name)
Specified by:
hasRole in interface Authorization
See Also:
Authorization.hasRole(java.lang.String)

addWorkingOnRole

protected void addWorkingOnRole(Role role)
Adds working role to working on roles by this Autorization object.

Parameters:
role - to be added role.

removeWorkingOnRole

protected void removeWorkingOnRole(Role role)
Removes working on role.

Parameters:
role - to be removed from working by this Autorization object roles.

isWorkingOnRole

protected boolean isWorkingOnRole(Role role)
Check if current Autorization object is working on provided role. This check will avoid loop when Autorization is looking for imply roles.

Parameters:
role - Role on which Autorization object is working.
Returns:
true if this Autorization object is already working on provided role false if not.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.