Package cz.metacentrum.perun.core.api
Class RoleManagementRules
java.lang.Object
cz.metacentrum.perun.core.api.RoleManagementRules
RoleManagementRules represents a set of rules which is used to determine principal's access rights for managing and reading a role.
Moreover, it contains allowed combinations of object and entity to/from which will be the role un/assigned
and related roles which can also read attribute value if the role can.
Each object and entity also contains a mapping to the specific column in the authz table,
so the database query can be created and executed more generally.
roleName is role's unique identification which is used in the configuration file perun-roles.yml
primaryObject serves to determine with which object is the role primarily connected. Other objects are just complementary.
privilegedRolesToManage serves to determine which roles (in relation to which objects) a user/group has to have, to have rights to set/unset the role to other users/groups.
It is a list of maps where each map entry consists from a role name as a key and a role object as a value.
Relation between each map in the list is logical OR and relation between each entry in the map is logical AND.
Example list - (Map1, Map2...)
Example map - key: VOADMIN ; value: Vo
key: GROUPADMIN ; value: Group
privilegedRolesToRead is same as the privilegedRolesToManage, but its purpose is to determine which roles have rights to read the roleName.
entitiesToManage is a map of entities which can be set to the role. Key is a entity name and value is mapping to the database.
Example entry: key: User; value: user_id
assignedObjects is a map of objects which can be assigned with the role. Key is a object name and value is mapping to the database.
Example entry: key: Resource; value: resource_id
assignmentCheck is a list of maps defining which of the assigned objects should be checked for being critical (requiring MFA) when setting the role.
Example entry: key: MFA; value: Resource <- If resource is critical, MFA is required
Example entry: {} <- No MFA is required to set this role
Example entry: Key: MFA; value: <- No value means MFA is always required to set this role
associatedReadRoles is a list of related roles which are authorized to read attribute value if the main role is authorized.
Example list for groupadmin role - value: [GROUPOBSERVER]
assignableToAttributes is a flag that determines whether the role can appear in attribute policies.
skipMFA is a flag that whether the role should skip MFA check.
mfaCriticalRole is a flag marking roles always requiring MFA from users having that role
displayName is a more user-friendly name
receiveNotifications contains names of objects for which the role should get notifications
Example value: Vo ; meaning: will receive notifications when vo application is created/failed
-
Constructor Summary
ConstructorsConstructorDescriptionRoleManagementRules
(String roleName, String primaryObject, List<Map<String, String>> privilegedRolesToManage, List<Map<String, String>> privilegedRolesToRead, Map<String, String> entitiesToManage, Map<String, String> assignedObjects, List<Map<String, String>> assignmentCheck, List<String> associatedReadRoles, boolean assignableToAttributes, boolean skipMFA, boolean mfaCriticalRole, String displayName, List<String> receiveNotifications) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
boolean
boolean
void
setAssignableToAttributes
(boolean assignableToAttributes) void
setAssignedObjects
(Map<String, String> assignedObjects) void
setAssignmentCheck
(List<Map<String, String>> assignmentCheck) void
setAssociatedReadRoles
(List<String> associatedReadRoles) void
setDisplayName
(String displayName) void
setEntitiesToManage
(Map<String, String> entitiesToManage) void
setMfaCriticalRole
(boolean mfaCriticalRole) void
setPrimaryObject
(String primaryObject) void
setPrivilegedRolesToManage
(List<Map<String, String>> privilegedRolesToManage) void
setPrivilegedRolesToRead
(List<Map<String, String>> privilegedRolesToRead) void
setReceiveNotifications
(List<String> receiveNotifications) void
setRoleName
(String roleName) void
setSkipMFA
(boolean skipMFA) boolean
toString()
-
Constructor Details
-
RoleManagementRules
public RoleManagementRules(String roleName, String primaryObject, List<Map<String, String>> privilegedRolesToManage, List<Map<String, String>> privilegedRolesToRead, Map<String, String> entitiesToManage, Map<String, String> assignedObjects, List<Map<String, String>> assignmentCheck, List<String> associatedReadRoles, boolean assignableToAttributes, boolean skipMFA, boolean mfaCriticalRole, String displayName, List<String> receiveNotifications)
-
-
Method Details
-
getRoleName
-
setRoleName
-
getPrimaryObject
-
setPrimaryObject
-
getPrivilegedRolesToManage
-
setPrivilegedRolesToManage
-
getPrivilegedRolesToRead
-
setPrivilegedRolesToRead
-
getEntitiesToManage
-
setEntitiesToManage
-
getAssignedObjects
-
setAssignedObjects
-
getAssignmentCheck
-
setAssignmentCheck
-
getAssociatedReadRoles
-
setAssociatedReadRoles
-
isAssignableToAttributes
public boolean isAssignableToAttributes() -
setAssignableToAttributes
public void setAssignableToAttributes(boolean assignableToAttributes) -
shouldSkipMFA
public boolean shouldSkipMFA() -
setSkipMFA
public void setSkipMFA(boolean skipMFA) -
isMfaCriticalRole
public boolean isMfaCriticalRole() -
setMfaCriticalRole
public void setMfaCriticalRole(boolean mfaCriticalRole) -
getDisplayName
-
setDisplayName
-
getReceiveNotifications
-
setReceiveNotifications
-
equals
-
hashCode
public int hashCode() -
toString
-