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 RoleManager
RoleProfileManager:
-
-
Constructor Summary
Constructors Constructor Description DefaultRoleManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assignRole(String roleId, String principal)
Assigns the role indicated by the roleId to the given principalvoid
assignRoleByName(String roleName, String principal)
Assigns the role indicated by the roleName to the given principalvoid
assignTemplatedRole(String templateId, String resource, String principal)
Assigns the templated role indicated by the templateId fails if the templated role has not been createdString
createTemplatedRole(String templateId, String resource)
create a role for the given roleName using the resource passed in for resolving the ${resource} expressionRedbackRoleModel
getBlessedModel()
Map<String,ModelApplication>
getKnownResources()
RedbackRoleModel
getModel()
get the blessed model, the current operating instructions for all things role managementRoleModelProcessor
getModelProcessor()
RoleModelValidator
getModelValidator()
RBACManager
getRbacManager()
RoleTemplateProcessor
getTemplateProcessor()
RedbackRoleModel
getUnblessedModel()
void
initialize()
intialize the role managervoid
loadApplication(ModelApplication app)
void
loadRoleModel(URL resource)
load the model and create/verify operations, resources, etc exist and make static rolesvoid
loadRoleModel(RedbackRoleModel roleModel)
String
moveTemplatedRole(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 identifiervoid
removeTemplatedRole(String templateId, String resource)
remove the role corresponding to the role using the resource passed in for resolving the ${resource} expressionboolean
roleExists(String roleId)
true of a role exists with the given roleIdvoid
setBlessedModel(RedbackRoleModel blessedModel)
void
setKnownResources(Map<String,ModelApplication> knownResources)
void
setModelProcessor(RoleModelProcessor modelProcessor)
void
setModelValidator(RoleModelValidator modelValidator)
void
setRbacManager(RBACManager rbacManager)
void
setTemplateProcessor(RoleTemplateProcessor templateProcessor)
void
setUnblessedModel(RedbackRoleModel unblessedModel)
boolean
templatedRoleExists(String templateId, String resource)
true of a role exists with the given roleIdvoid
unassignRole(String roleId, String principal)
Unassigns the role indicated by the role id from the given principalvoid
unassignRoleByName(String roleName, String principal)
Unassigns the role indicated by the role name from the given principalvoid
verifyTemplatedRole(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:RoleManager
load the model and create/verify operations, resources, etc exist and make static roles- Specified by:
loadRoleModel
in interfaceRoleManager
- Throws:
RoleManagerException
-
loadRoleModel
public void loadRoleModel(RedbackRoleModel roleModel) throws RoleManagerException
- Specified by:
loadRoleModel
in 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:
createTemplatedRole
in 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:
removeTemplatedRole
in 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:
moveTemplatedRole
in 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:RoleManager
Assigns the role indicated by the roleId to the given principal- Specified by:
assignRole
in interfaceRoleManager
- Throws:
RoleManagerException
-
assignRoleByName
public void assignRoleByName(String roleName, String principal) throws RoleManagerException
Description copied from interface:RoleManager
Assigns the role indicated by the roleName to the given principal- Specified by:
assignRoleByName
in interfaceRoleManager
- Throws:
RoleManagerException
-
assignTemplatedRole
public void assignTemplatedRole(String templateId, String resource, String principal) throws RoleManagerException
Description copied from interface:RoleManager
Assigns the templated role indicated by the templateId fails if the templated role has not been created- Specified by:
assignTemplatedRole
in interfaceRoleManager
- Throws:
RoleManagerException
-
unassignRole
public void unassignRole(String roleId, String principal) throws RoleManagerException
Description copied from interface:RoleManager
Unassigns the role indicated by the role id from the given principal- Specified by:
unassignRole
in interfaceRoleManager
- Throws:
RoleManagerException
-
unassignRoleByName
public void unassignRoleByName(String roleName, String principal) throws RoleManagerException
Description copied from interface:RoleManager
Unassigns the role indicated by the role name from the given principal- Specified by:
unassignRoleByName
in interfaceRoleManager
- Throws:
RoleManagerException
-
roleExists
public boolean roleExists(String roleId) throws RoleManagerException
Description copied from interface:RoleManager
true of a role exists with the given roleId- Specified by:
roleExists
in interfaceRoleManager
- Returns:
- Throws:
RoleManagerException
-
templatedRoleExists
public boolean templatedRoleExists(String templateId, String resource) throws RoleManagerException
Description copied from interface:RoleManager
true of a role exists with the given roleId- Specified by:
templatedRoleExists
in interfaceRoleManager
- Returns:
- Throws:
RoleManagerException
-
initialize
@PostConstruct public void initialize()
Description copied from interface:RoleManager
intialize the role manager- Specified by:
initialize
in interfaceRoleManager
-
getModel
public RedbackRoleModel getModel()
Description copied from interface:RoleManager
get the blessed model, the current operating instructions for all things role management- Specified by:
getModel
in interfaceRoleManager
-
verifyTemplatedRole
public void verifyTemplatedRole(String templateId, String resource) throws RoleManagerException
Description copied from interface:RoleManager
Check a role template is complete in the RBAC store.- Specified by:
verifyTemplatedRole
in 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)
-
-