org.wso2.carbon.registry.core.jdbc.realm
Class RegistryAuthorizationManager

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.realm.RegistryAuthorizationManager
All Implemented Interfaces:
org.wso2.carbon.user.api.AuthorizationManager

public class RegistryAuthorizationManager
extends Object
implements org.wso2.carbon.user.core.AuthorizationManager

The Registry wrapper for the authorization manager.


Constructor Summary
RegistryAuthorizationManager(org.wso2.carbon.user.core.UserRealm coreRealm)
          Construct the registry authorization manager
 
Method Summary
 void authorizeRole(String roleName, String resourceId, String action)
          Authorize role for an action on a resource.
 void authorizeUser(String userName, String resourceId, String action)
          Deprecated. 
 void clearResourceAuthorizations(String resourceId)
          clear the resource authorizations.
 void clearRoleActionOnAllResources(String roleName, String action)
          Get the explicitly denied users for a resource.
 void clearRoleAuthorization(String roleName)
          Clear the role authorization.
 void clearRoleAuthorization(String roleName, String resourceId, String action)
          Clear the role authorization for a given resource id and action.
 void clearUserAuthorization(String userName)
          Deprecated. 
 void clearUserAuthorization(String userName, String resourceId, String action)
          Deprecated. 
 void denyRole(String roleName, String resourceId, String action)
          Deny role to do an action on a resource.
 void denyUser(String userName, String resourceId, String action)
          Deprecated. 
 String[] getAllowedRolesForResource(String resourceId, String action)
          Get allowed roles for a resource to do an action.
 String[] getAllowedUIResourcesForUser(String userName, String permissionRootPath)
          Get the allowed UI resources for a user.
 String[] getDeniedRolesForResource(String resourceId, String action)
          Get denied roles for a resource to do an action.
 String[] getExplicitlyAllowedUsersForResource(String resourceId, String action)
          Deprecated. 
 String[] getExplicitlyDeniedUsersForResource(String resourceId, String action)
          Deprecated. 
 int getTenantId()
          this will get the tenant id associated with the user authorization manager
 boolean isRoleAuthorized(String roleName, String resourceId, String action)
          Check whether the role is authorized do an action on a resource.
 boolean isUserAuthorized(String userName, String resourceId, String action)
          Check whether the user is authorized to do an action on a resource.
 void resetPermissionOnUpdateRole(String roleName, String newRoleName)
          this will reset the permission of the renamed role
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryAuthorizationManager

public RegistryAuthorizationManager(org.wso2.carbon.user.core.UserRealm coreRealm)
Construct the registry authorization manager

Parameters:
coreRealm - the realm to wrap.
Method Detail

clearUserAuthorization

@Deprecated
public void clearUserAuthorization(String userName,
                                              String resourceId,
                                              String action)
                            throws org.wso2.carbon.user.core.UserStoreException
Deprecated. 

Clear user authorization for a given resource and action.

Specified by:
clearUserAuthorization in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
userName - the user name.
resourceId - the resource id.
action - the action.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

clearRoleAuthorization

public void clearRoleAuthorization(String roleName,
                                   String resourceId,
                                   String action)
                            throws org.wso2.carbon.user.core.UserStoreException
Clear the role authorization for a given resource id and action.

Specified by:
clearRoleAuthorization in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
roleName - the role name.
resourceId - the resource id.
action - the action.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

authorizeUser

@Deprecated
public void authorizeUser(String userName,
                                     String resourceId,
                                     String action)
                   throws org.wso2.carbon.user.core.UserStoreException
Deprecated. 

Authorize user for an action on a resource.

Specified by:
authorizeUser in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
userName - the user name.
resourceId - the resource id.
action - the action.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

authorizeRole

public void authorizeRole(String roleName,
                          String resourceId,
                          String action)
                   throws org.wso2.carbon.user.core.UserStoreException
Authorize role for an action on a resource.

Specified by:
authorizeRole in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
roleName - the role name.
resourceId - the resource id.
action - the action.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

clearResourceAuthorizations

public void clearResourceAuthorizations(String resourceId)
                                 throws org.wso2.carbon.user.core.UserStoreException
clear the resource authorizations.

Specified by:
clearResourceAuthorizations in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
resourceId - the resource id.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

isUserAuthorized

public boolean isUserAuthorized(String userName,
                                String resourceId,
                                String action)
                         throws org.wso2.carbon.user.core.UserStoreException
Check whether the user is authorized to do an action on a resource.

Specified by:
isUserAuthorized in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
userName - the user name.
resourceId - the resource id.
action - the action.
Returns:
true, if the user is authorized, false otherwise.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

isRoleAuthorized

public boolean isRoleAuthorized(String roleName,
                                String resourceId,
                                String action)
                         throws org.wso2.carbon.user.core.UserStoreException
Check whether the role is authorized do an action on a resource.

Specified by:
isRoleAuthorized in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
roleName - the role name.
resourceId - the resource id.
action - the action.
Returns:
true, if the role is authorized, false otherwise.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

getAllowedRolesForResource

public String[] getAllowedRolesForResource(String resourceId,
                                           String action)
                                    throws org.wso2.carbon.user.core.UserStoreException
Get allowed roles for a resource to do an action.

Specified by:
getAllowedRolesForResource in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
resourceId - the resource id.
action - the action.
Returns:
the allowed roles.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

denyRole

public void denyRole(String roleName,
                     String resourceId,
                     String action)
              throws org.wso2.carbon.user.core.UserStoreException
Deny role to do an action on a resource.

Specified by:
denyRole in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
roleName - the role name.
resourceId - the resource id.
action - the action.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

denyUser

@Deprecated
public void denyUser(String userName,
                                String resourceId,
                                String action)
              throws org.wso2.carbon.user.core.UserStoreException
Deprecated. 

Deny user to do an action on a resource.

Specified by:
denyUser in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
userName - the user name.
resourceId - the resource id.
action - the action.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

getDeniedRolesForResource

public String[] getDeniedRolesForResource(String resourceId,
                                          String action)
                                   throws org.wso2.carbon.user.core.UserStoreException
Get denied roles for a resource to do an action.

Specified by:
getDeniedRolesForResource in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
resourceId - the resource id.
action - the action.
Returns:
the denied roles array.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

getExplicitlyAllowedUsersForResource

@Deprecated
public String[] getExplicitlyAllowedUsersForResource(String resourceId,
                                                                String action)
                                              throws org.wso2.carbon.user.core.UserStoreException
Deprecated. 

Get the explicitly allowed users for a resource.

Specified by:
getExplicitlyAllowedUsersForResource in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
resourceId - the resource id.
action - the action.
Returns:
the denied roles array.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

getExplicitlyDeniedUsersForResource

@Deprecated
public String[] getExplicitlyDeniedUsersForResource(String resourceId,
                                                               String action)
                                             throws org.wso2.carbon.user.core.UserStoreException
Deprecated. 

Get the explicitly denied users for a resource.

Specified by:
getExplicitlyDeniedUsersForResource in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
resourceId - the resource id.
action - the action.
Returns:
the denied roles array.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

clearRoleActionOnAllResources

public void clearRoleActionOnAllResources(String roleName,
                                          String action)
                                   throws org.wso2.carbon.user.core.UserStoreException
Get the explicitly denied users for a resource.

Specified by:
clearRoleActionOnAllResources in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
roleName - the role name.
action - the action.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

getAllowedUIResourcesForUser

public String[] getAllowedUIResourcesForUser(String userName,
                                             String permissionRootPath)
                                      throws org.wso2.carbon.user.core.UserStoreException
Get the allowed UI resources for a user.

Specified by:
getAllowedUIResourcesForUser in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
userName - the user name.
Returns:
an array of users.
Throws:
org.wso2.carbon.user.core.UserStoreException - if the operation failed.

clearRoleAuthorization

public void clearRoleAuthorization(String roleName)
                            throws org.wso2.carbon.user.core.UserStoreException
Clear the role authorization.

Specified by:
clearRoleAuthorization in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
roleName - the role name.
Throws:
org.wso2.carbon.user.core.UserStoreException - if the operation failed.

clearUserAuthorization

@Deprecated
public void clearUserAuthorization(String userName)
                            throws org.wso2.carbon.user.core.UserStoreException
Deprecated. 

Clear the user authorization.

Specified by:
clearUserAuthorization in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
userName - the user name.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

getTenantId

public int getTenantId()
                throws org.wso2.carbon.user.core.UserStoreException
this will get the tenant id associated with the user authorization manager

Specified by:
getTenantId in interface org.wso2.carbon.user.api.AuthorizationManager
Returns:
the tenant id of the authorization manager
Throws:
org.wso2.carbon.user.core.UserStoreException - if the operation failed

resetPermissionOnUpdateRole

public void resetPermissionOnUpdateRole(String roleName,
                                        String newRoleName)
                                 throws org.wso2.carbon.user.core.UserStoreException
this will reset the permission of the renamed role

Specified by:
resetPermissionOnUpdateRole in interface org.wso2.carbon.user.api.AuthorizationManager
Parameters:
roleName - existing role name.
newRoleName - new role name.
Throws:
org.wso2.carbon.user.core.UserStoreException - if the operation failed


Copyright © 2011 WSO2 Inc. All Rights Reserved.