Package org.apache.archiva.redback.role
Class DefaultRoleManager
- java.lang.Object
-
- org.apache.archiva.redback.role.DefaultRoleManager
-
- All Implemented Interfaces:
RoleManager
@Service("roleManager") public class DefaultRoleManager extends Object implements RoleManagerRoleProfileManager:
-
-
Constructor Summary
Constructors Constructor Description DefaultRoleManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignRole(String roleId, String principal)Assigns the role indicated by the roleId to the given principalvoidassignRoleByName(String roleName, String principal)Assigns the role indicated by the roleName to the given principalvoidassignTemplatedRole(String templateId, String resource, String principal)Assigns the templated role indicated by the templateId fails if the templated role has not been createdStringcreateTemplatedRole(String templateId, String resource)create a role for the given roleName using the resource passed in for resolving the ${resource} expressionRedbackRoleModelgetBlessedModel()Map<String,ModelApplication>getKnownResources()RedbackRoleModelgetModel()get the blessed model, the current operating instructions for all things role managementRoleModelProcessorgetModelProcessor()RoleModelValidatorgetModelValidator()RBACManagergetRbacManager()RoleTemplateProcessorgetTemplateProcessor()RedbackRoleModelgetUnblessedModel()voidinitialize()intialize the role managervoidloadApplication(ModelApplication app)voidloadRoleModel(URL resource)load the model and create/verify operations, resources, etc exist and make static rolesvoidloadRoleModel(RedbackRoleModel roleModel)StringmoveTemplatedRole(String templateId, String oldResource, String newResource)update the role from templateId from oldResource to newResource NOTE: this requires removal and creation of the role since the jdo store does not tolerate renaming because of the use of the name as an identifiervoidremoveTemplatedRole(String templateId, String resource)remove the role corresponding to the role using the resource passed in for resolving the ${resource} expressionbooleanroleExists(String roleId)true of a role exists with the given roleIdvoidsetBlessedModel(RedbackRoleModel blessedModel)voidsetKnownResources(Map<String,ModelApplication> knownResources)voidsetModelProcessor(RoleModelProcessor modelProcessor)voidsetModelValidator(RoleModelValidator modelValidator)voidsetRbacManager(RBACManager rbacManager)voidsetTemplateProcessor(RoleTemplateProcessor templateProcessor)voidsetUnblessedModel(RedbackRoleModel unblessedModel)booleantemplatedRoleExists(String templateId, String resource)true of a role exists with the given roleIdvoidunassignRole(String roleId, String principal)Unassigns the role indicated by the role id from the given principalvoidunassignRoleByName(String roleName, String principal)Unassigns the role indicated by the role name from the given principalvoidverifyTemplatedRole(String templateId, String resource)Check a role template is complete in the RBAC store.
-
-
-
Constructor Detail
-
DefaultRoleManager
public DefaultRoleManager()
-
-
Method Detail
-
loadRoleModel
public void loadRoleModel(URL resource) throws RoleManagerException
Description copied from interface:RoleManagerload the model and create/verify operations, resources, etc exist and make static roles- Specified by:
loadRoleModelin interfaceRoleManager- Throws:
RoleManagerException
-
loadRoleModel
public void loadRoleModel(RedbackRoleModel roleModel) throws RoleManagerException
- Specified by:
loadRoleModelin interfaceRoleManager- Throws:
RoleManagerException
-
loadApplication
public void loadApplication(ModelApplication app) throws RoleManagerException
- Throws:
RoleManagerException
-
createTemplatedRole
public String createTemplatedRole(String templateId, String resource) throws RoleManagerException
create a role for the given roleName using the resource passed in for resolving the ${resource} expression- Specified by:
createTemplatedRolein interfaceRoleManager- Throws:
RoleManagerException
-
removeTemplatedRole
public void removeTemplatedRole(String templateId, String resource) throws RoleManagerException
remove the role corresponding to the role using the resource passed in for resolving the ${resource} expression- Specified by:
removeTemplatedRolein interfaceRoleManager- Throws:
RoleManagerException
-
moveTemplatedRole
public String moveTemplatedRole(String templateId, String oldResource, String newResource) throws RoleManagerException
update the role from templateId from oldResource to newResource NOTE: this requires removal and creation of the role since the jdo store does not tolerate renaming because of the use of the name as an identifier- Specified by:
moveTemplatedRolein interfaceRoleManager- Parameters:
templateId- the name of the role templateoldResource- the old resource namenewResource- the new resource name- Throws:
RoleManagerException
-
assignRole
public void assignRole(String roleId, String principal) throws RoleManagerException
Description copied from interface:RoleManagerAssigns the role indicated by the roleId to the given principal- Specified by:
assignRolein interfaceRoleManager- Throws:
RoleManagerException
-
assignRoleByName
public void assignRoleByName(String roleName, String principal) throws RoleManagerException
Description copied from interface:RoleManagerAssigns the role indicated by the roleName to the given principal- Specified by:
assignRoleByNamein interfaceRoleManager- Throws:
RoleManagerException
-
assignTemplatedRole
public void assignTemplatedRole(String templateId, String resource, String principal) throws RoleManagerException
Description copied from interface:RoleManagerAssigns the templated role indicated by the templateId fails if the templated role has not been created- Specified by:
assignTemplatedRolein interfaceRoleManager- Throws:
RoleManagerException
-
unassignRole
public void unassignRole(String roleId, String principal) throws RoleManagerException
Description copied from interface:RoleManagerUnassigns the role indicated by the role id from the given principal- Specified by:
unassignRolein interfaceRoleManager- Throws:
RoleManagerException
-
unassignRoleByName
public void unassignRoleByName(String roleName, String principal) throws RoleManagerException
Description copied from interface:RoleManagerUnassigns the role indicated by the role name from the given principal- Specified by:
unassignRoleByNamein interfaceRoleManager- Throws:
RoleManagerException
-
roleExists
public boolean roleExists(String roleId) throws RoleManagerException
Description copied from interface:RoleManagertrue of a role exists with the given roleId- Specified by:
roleExistsin interfaceRoleManager- Returns:
- Throws:
RoleManagerException
-
templatedRoleExists
public boolean templatedRoleExists(String templateId, String resource) throws RoleManagerException
Description copied from interface:RoleManagertrue of a role exists with the given roleId- Specified by:
templatedRoleExistsin interfaceRoleManager- Returns:
- Throws:
RoleManagerException
-
initialize
@PostConstruct public void initialize()
Description copied from interface:RoleManagerintialize the role manager- Specified by:
initializein interfaceRoleManager
-
getModel
public RedbackRoleModel getModel()
Description copied from interface:RoleManagerget the blessed model, the current operating instructions for all things role management- Specified by:
getModelin interfaceRoleManager
-
verifyTemplatedRole
public void verifyTemplatedRole(String templateId, String resource) throws RoleManagerException
Description copied from interface:RoleManagerCheck a role template is complete in the RBAC store.- Specified by:
verifyTemplatedRolein interfaceRoleManager- Parameters:
templateId- the templated roleresource- the resource to verify- Throws:
RoleManagerException
-
getBlessedModel
public RedbackRoleModel getBlessedModel()
-
setBlessedModel
public void setBlessedModel(RedbackRoleModel blessedModel)
-
getUnblessedModel
public RedbackRoleModel getUnblessedModel()
-
setUnblessedModel
public void setUnblessedModel(RedbackRoleModel unblessedModel)
-
getKnownResources
public Map<String,ModelApplication> getKnownResources()
-
setKnownResources
public void setKnownResources(Map<String,ModelApplication> knownResources)
-
getModelValidator
public RoleModelValidator getModelValidator()
-
setModelValidator
public void setModelValidator(RoleModelValidator modelValidator)
-
getModelProcessor
public RoleModelProcessor getModelProcessor()
-
setModelProcessor
public void setModelProcessor(RoleModelProcessor modelProcessor)
-
getTemplateProcessor
public RoleTemplateProcessor getTemplateProcessor()
-
setTemplateProcessor
public void setTemplateProcessor(RoleTemplateProcessor templateProcessor)
-
getRbacManager
public RBACManager getRbacManager()
-
setRbacManager
public void setRbacManager(RBACManager rbacManager)
-
-