org.wso2.registry.users.def
Class DefaultAuthorizer

java.lang.Object
  extended by org.wso2.registry.users.def.DefaultAuthorizer
All Implemented Interfaces:
Authorizer
Direct Known Subclasses:
DefaultAccessControlAdmin

public class DefaultAuthorizer
extends java.lang.Object
implements Authorizer

See Also:
org.wso2.usermanager.Authorizer

Field Summary
protected  javax.sql.DataSource dataSource
          DBCP datasource
 
Constructor Summary
DefaultAuthorizer(javax.sql.DataSource dataSource, java.lang.String algo)
           
 
Method Summary
 java.lang.String[] getAllowedRolesForResource(java.lang.String resourceId, java.lang.String action)
          Returns all roles who are authorized to perform an action on a resource
 java.lang.String[] getAllowedUsersForResource(java.lang.String resourceId, java.lang.String action)
          Returns all users who are authorized to perform an action on a resource
 java.lang.String[] getDeniedRolesForResource(java.lang.String resourceId, java.lang.String action)
          Returns all roles who are authorized to perform an action on a resource
 java.lang.String[] getDeniedUsersForResource(java.lang.String resourceId, java.lang.String action)
          Returns all users who are authorized to perform an action on a resource
 boolean isRoleAuthorized(java.lang.String roleName, java.lang.String resourceId, java.lang.String action)
          Checks wheather an role is authorized to perfrom an action on a resource
 boolean isUserAuthorized(java.lang.String userName, java.lang.String resourceId, java.lang.String action)
          Checks wheather an user is authorized to perfrom an action on a resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

protected javax.sql.DataSource dataSource
DBCP datasource

Constructor Detail

DefaultAuthorizer

public DefaultAuthorizer(javax.sql.DataSource dataSource,
                         java.lang.String algo)
Method Detail

isRoleAuthorized

public boolean isRoleAuthorized(java.lang.String roleName,
                                java.lang.String resourceId,
                                java.lang.String action)
                         throws UserStoreException
Description copied from interface: Authorizer
Checks wheather an role is authorized to perfrom an action on a resource

Specified by:
isRoleAuthorized in interface Authorizer
Throws:
UserStoreException

isUserAuthorized

public boolean isUserAuthorized(java.lang.String userName,
                                java.lang.String resourceId,
                                java.lang.String action)
                         throws UserStoreException
Description copied from interface: Authorizer
Checks wheather an user is authorized to perfrom an action on a resource

Specified by:
isUserAuthorized in interface Authorizer
Throws:
UserStoreException

getAllowedUsersForResource

public java.lang.String[] getAllowedUsersForResource(java.lang.String resourceId,
                                                     java.lang.String action)
                                              throws UserStoreException
Description copied from interface: Authorizer
Returns all users who are authorized to perform an action on a resource

Specified by:
getAllowedUsersForResource in interface Authorizer
Throws:
UserStoreException

getDeniedUsersForResource

public java.lang.String[] getDeniedUsersForResource(java.lang.String resourceId,
                                                    java.lang.String action)
                                             throws UserStoreException
Description copied from interface: Authorizer
Returns all users who are authorized to perform an action on a resource

Specified by:
getDeniedUsersForResource in interface Authorizer
Throws:
UserStoreException

getAllowedRolesForResource

public java.lang.String[] getAllowedRolesForResource(java.lang.String resourceId,
                                                     java.lang.String action)
                                              throws UserStoreException
Description copied from interface: Authorizer
Returns all roles who are authorized to perform an action on a resource

Specified by:
getAllowedRolesForResource in interface Authorizer
Throws:
UserStoreException

getDeniedRolesForResource

public java.lang.String[] getDeniedRolesForResource(java.lang.String resourceId,
                                                    java.lang.String action)
                                             throws UserStoreException
Description copied from interface: Authorizer
Returns all roles who are authorized to perform an action on a resource

Specified by:
getDeniedRolesForResource in interface Authorizer
Throws:
UserStoreException


Copyright © 2007 Apache Web Services Project. All Rights Reserved.