org.wso2.registry.users.def
Class DefaultAccessControlAdmin

java.lang.Object
  extended by org.wso2.registry.users.def.DefaultAuthorizer
      extended by org.wso2.registry.users.def.DefaultAccessControlAdmin
All Implemented Interfaces:
AccessControlAdmin, Authorizer

public class DefaultAccessControlAdmin
extends DefaultAuthorizer
implements AccessControlAdmin


Field Summary
 
Fields inherited from class org.wso2.registry.users.def.DefaultAuthorizer
dataSource
 
Constructor Summary
DefaultAccessControlAdmin(javax.sql.DataSource dataSource)
           
DefaultAccessControlAdmin(javax.sql.DataSource dataSource, java.lang.String algo)
           
 
Method Summary
protected  void addAllowDenyRolePermission(java.lang.String roleName, java.lang.String resourceId, java.lang.String action, short allow)
           
protected  void addAllowDenyUserPermission(java.lang.String userName, java.lang.String resourceId, java.lang.String action, short allow)
           
 void authorizeRole(java.lang.String roleName, java.lang.String resourceId, java.lang.String action)
          Grant access to role
 void authorizeUser(java.lang.String userName, java.lang.String resourceId, java.lang.String action)
          Grant access to user.
 void clearResourceAuthorizations(java.lang.String resourceId)
          Clears all authorizations on a Role
 void clearRoleAuthorization(java.lang.String roleName, java.lang.String resourceId, java.lang.String action)
          Removes granted access from Role
 void clearUserAuthorization(java.lang.String userName, java.lang.String resourceId, java.lang.String action)
          Removes granted access from user
 void copyAuthorizations(java.lang.String fromResourceId, java.lang.String toResourceId)
          Duplicates granted/denied access
 void denyRole(java.lang.String roleName, java.lang.String resourceId, java.lang.String action)
          Deny access to role
 void denyUser(java.lang.String userName, java.lang.String resourceId, java.lang.String action)
          Deny access to user
protected  int getOrAddPermissionId(java.sql.Connection dbConnection, java.lang.String resourceId, java.lang.String action)
          Gets the permission if it exists, else create the permission and returns the id.
 
Methods inherited from class org.wso2.registry.users.def.DefaultAuthorizer
getAllowedRolesForResource, getAllowedUsersForResource, getDeniedRolesForResource, getDeniedUsersForResource, isRoleAuthorized, isUserAuthorized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.wso2.registry.users.Authorizer
getAllowedRolesForResource, getAllowedUsersForResource, getDeniedRolesForResource, getDeniedUsersForResource, isRoleAuthorized, isUserAuthorized
 

Constructor Detail

DefaultAccessControlAdmin

public DefaultAccessControlAdmin(javax.sql.DataSource dataSource,
                                 java.lang.String algo)

DefaultAccessControlAdmin

public DefaultAccessControlAdmin(javax.sql.DataSource dataSource)
Method Detail

clearUserAuthorization

public void clearUserAuthorization(java.lang.String userName,
                                   java.lang.String resourceId,
                                   java.lang.String action)
                            throws UserStoreException
Description copied from interface: AccessControlAdmin
Removes granted access from user

Specified by:
clearUserAuthorization in interface AccessControlAdmin
Throws:
UserStoreException

denyUser

public void denyUser(java.lang.String userName,
                     java.lang.String resourceId,
                     java.lang.String action)
              throws UserStoreException
Description copied from interface: AccessControlAdmin
Deny access to user

Specified by:
denyUser in interface AccessControlAdmin
Throws:
UserStoreException

authorizeRole

public void authorizeRole(java.lang.String roleName,
                          java.lang.String resourceId,
                          java.lang.String action)
                   throws UserStoreException
Description copied from interface: AccessControlAdmin
Grant access to role

Specified by:
authorizeRole in interface AccessControlAdmin
Throws:
UserStoreException

denyRole

public void denyRole(java.lang.String roleName,
                     java.lang.String resourceId,
                     java.lang.String action)
              throws UserStoreException
Description copied from interface: AccessControlAdmin
Deny access to role

Specified by:
denyRole in interface AccessControlAdmin
Throws:
UserStoreException

clearRoleAuthorization

public void clearRoleAuthorization(java.lang.String roleName,
                                   java.lang.String resourceId,
                                   java.lang.String action)
                            throws UserStoreException
Description copied from interface: AccessControlAdmin
Removes granted access from Role

Specified by:
clearRoleAuthorization in interface AccessControlAdmin
Throws:
UserStoreException

clearResourceAuthorizations

public void clearResourceAuthorizations(java.lang.String resourceId)
                                 throws UserStoreException
Description copied from interface: AccessControlAdmin
Clears all authorizations on a Role

Specified by:
clearResourceAuthorizations in interface AccessControlAdmin
Throws:
UserStoreException

copyAuthorizations

public void copyAuthorizations(java.lang.String fromResourceId,
                               java.lang.String toResourceId)
                        throws UserStoreException
Description copied from interface: AccessControlAdmin
Duplicates granted/denied access

Specified by:
copyAuthorizations in interface AccessControlAdmin
Throws:
UserStoreException

authorizeUser

public void authorizeUser(java.lang.String userName,
                          java.lang.String resourceId,
                          java.lang.String action)
                   throws UserStoreException
Description copied from interface: AccessControlAdmin
Grant access to user.

Specified by:
authorizeUser in interface AccessControlAdmin
Throws:
UserStoreException

getOrAddPermissionId

protected int getOrAddPermissionId(java.sql.Connection dbConnection,
                                   java.lang.String resourceId,
                                   java.lang.String action)
                            throws UserStoreException
Gets the permission if it exists, else create the permission and returns the id.

Returns:
the id of the permission
Throws:
UserStoreException

addAllowDenyUserPermission

protected void addAllowDenyUserPermission(java.lang.String userName,
                                          java.lang.String resourceId,
                                          java.lang.String action,
                                          short allow)
                                   throws UserStoreException
Throws:
UserStoreException

addAllowDenyRolePermission

protected void addAllowDenyRolePermission(java.lang.String roleName,
                                          java.lang.String resourceId,
                                          java.lang.String action,
                                          short allow)
                                   throws UserStoreException
Throws:
UserStoreException


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