Class GroupRolesConfig
java.lang.Object
com.polarion.platform.spi.security.GroupRolesConfig
Object encapsulation of the group-roles.xml configuration file.
This class it NOT thread safe!
- Since:
- 3.19.3
-
Constructor Summary
ConstructorDescriptionCreates an empty configuration.GroupRolesConfig
(InputStream in, ILocation loc) Parses the XML configuration from the input stream & closes it. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addRolesToGroup
(Collection<String> roleIds, String groupId) Adds Role(s) to the given Group.getGroupRoles
(String groupId) Returns the Role(s) assigned to the given Group by the currently loaded group-roles.xml file.getGroupsForRole
(String roleId) Returns The Group(s) with the Role that's assigned by the currently loaded group-roles.xml file.boolean
removeGroup
(String groupId) Removes User Group from the current configuration.boolean
removeRoleFromGroups
(String roleId) Removes the Role from all Groups.boolean
removeRolesFromGroup
(Collection<String> roleIds, String groupId) Removes Role(s) from the given Group.
-
Constructor Details
-
GroupRolesConfig
public GroupRolesConfig()Creates an empty configuration. -
GroupRolesConfig
Parses the XML configuration from the input stream & closes it.
-
-
Method Details
-
getGroupRoles
Returns the Role(s) assigned to the given Group by the currently loaded group-roles.xml file.- Parameters:
groupId
- The Group's ID.- Returns:
- set of Role IDs.
-
getGroupsForRole
Returns The Group(s) with the Role that's assigned by the currently loaded group-roles.xml file.- Parameters:
roleId
- The Role's ID.- Returns:
- set of Group IDs.
-
removeGroup
Removes User Group from the current configuration.- Parameters:
groupId
-- Returns:
true
if the User Group existed.
-
serialize
-
addRolesToGroup
Adds Role(s) to the given Group.- Parameters:
roleIds
- IDs of the Roles to add.groupId
- ID of the target Group.- Returns:
true
if at least one mapping was added.
-
removeRolesFromGroup
Removes Role(s) from the given Group.- Parameters:
roleIds
- IDs of the Roles to remove.groupId
- ID of the target Group.- Returns:
true
if at least one mapping was removed.
-
removeRoleFromGroups
Removes the Role from all Groups.- Parameters:
roleId
- ID of the Role to remove.- Returns:
true
if the Role existed in the mapping.
-