org.wso2.registry.users.hybrid
Class HybridAuthorizer

java.lang.Object
  extended by org.wso2.registry.users.hybrid.HybridAuthorizer
All Implemented Interfaces:
Authorizer
Direct Known Subclasses:
HybridAccessControlAdmin

public class HybridAuthorizer
extends java.lang.Object
implements Authorizer


Field Summary
protected  javax.sql.DataSource dataSource
          DBCP datasource
 
Constructor Summary
HybridAuthorizer(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
protected static java.lang.String[] getUserRoles(java.sql.Connection dbConnection, java.lang.String userName)
           
 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

HybridAuthorizer

public HybridAuthorizer(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

getUserRoles

protected static java.lang.String[] getUserRoles(java.sql.Connection dbConnection,
                                                 java.lang.String userName)
                                          throws UserStoreException
Throws:
UserStoreException


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