Interface RoleManager
- All Known Implementing Classes:
LiferayRoleManager,LiferayWSRoleManager
public interface RoleManager
This interface defines the manager class that manages the Roles and the Teams.
Groups (Sites) can group a set of user by creating a team.
The notion of a Team is somewhat similar to a Role but a Role is a portal wide entity (Role exists in any Site)
while a Team is restricted to a particular Site.
- Author:
- Massimiliano Assante, CNR-ISTI
-
Method Summary
Modifier and TypeMethodDescriptionbooleanassignRolesToUser(long userId, long groupId, long[] roleId) booleanassignRoleToUser(long userId, long groupId, long roleId) booleanassignTeamToUser(long userId, long teamId) associate one team to the existing teams of userbooleancreateRole(String roleName, String roleDescription) createTeam(long creatorUserId, long groupId, String teamName, String teamDescription) createTeam(long groupId, String teamName, String teamDescription) it will crate the Team as Administrator, use the other method to pass the userIdbooleandeleteRole(long roleId) deleteTeam(long teamId) booleandeleteTeams(long groupId) booleandeleteUserTeams(long userId, long[] teamIds) delete a user from a list of teamsbooleandeleteUserTeams(long userId, List<GCubeTeam> teams) delete a user from a list of teamsgetRole(long roleId) long* @param roleNamelonggetRoleIdByName(String roleName) * @param roleNamegetTeam(long teamId) booleanhasRole(long userId, long groupId, long roleId) booleanhasTeam(long userId, long teamId) booleanisAdmin(long userId) listRolesByUserAndGroup(long userId, long groupId) listTeamsByGroup(long groupId) listTeamsByUserAndGroup(long userId, long groupId) booleanremoveAllRolesFromUser(long userId, long... groupIds) booleanremoveRoleFromUser(long userId, long groupId, long roleId) booleansetUserTeams(long userId, long[] teamIds) associate or not associate teams to a userupdateRole(long roleId, String roleName, String roleDescription) updateTeam(long teamId, String teamName, String teamDescription)
-
Method Details
-
isAdmin
- Parameters:
userId- the LR UserId, not the username- Returns:
- true if the user is a portal administrator, false otherwise
- Throws:
UserRetrievalFault
-
hasRole
boolean hasRole(long userId, long groupId, long roleId) - Parameters:
userId- userId the LR UserId, not the usernamegroupId- the LR groupIdroleId- the LR roleId- Returns:
- true if the user has the role, false otherwise
-
hasTeam
boolean hasTeam(long userId, long teamId) - Parameters:
userId- userId the LR UserId, not the usernameteamId- the LR teamId- Returns:
-
assignRoleToUser
boolean assignRoleToUser(long userId, long groupId, long roleId) throws UserManagementSystemException, UserRetrievalFault, GroupRetrievalFault, RoleRetrievalFault - Parameters:
userId- the LR UserIdgroupId- the LR groupIdroleId- the LR roleId- Returns:
- Throws:
UserManagementSystemExceptionUserRetrievalFaultGroupRetrievalFaultRoleRetrievalFault
-
assignRolesToUser
boolean assignRolesToUser(long userId, long groupId, long[] roleId) throws UserManagementSystemException, UserRetrievalFault, GroupRetrievalFault, RoleRetrievalFault - Parameters:
userId- the LR UserIdgroupId- the LR groupIdroleId- the LR roleId- Returns:
- Throws:
UserManagementSystemExceptionUserRetrievalFaultGroupRetrievalFaultRoleRetrievalFault
-
createRole
- Parameters:
roleName-roleDescription-- Returns:
- true if the role is created succesfully
- Throws:
UserManagementSystemException
-
deleteRole
- Parameters:
roleId-- Returns:
- true if the role is deleted succesfully, false otherwise
- Throws:
UserManagementSystemExceptionRoleRetrievalFault
-
removeRoleFromUser
boolean removeRoleFromUser(long userId, long groupId, long roleId) throws UserManagementSystemException, UserRetrievalFault, GroupRetrievalFault, RoleRetrievalFault - Parameters:
userId-groupId-roleId-- Returns:
- Throws:
UserManagementSystemExceptionUserRetrievalFaultGroupRetrievalFaultRoleRetrievalFault
-
removeAllRolesFromUser
boolean removeAllRolesFromUser(long userId, long... groupIds) throws UserManagementSystemException, UserRetrievalFault, GroupRetrievalFault - Parameters:
userId-groupIds-- Returns:
- Throws:
UserManagementSystemExceptionUserRetrievalFaultGroupRetrievalFault
-
updateRole
GCubeRole updateRole(long roleId, String roleName, String roleDescription) throws RoleRetrievalFault - Parameters:
roleId-roleName-roleDescription-- Returns:
- Throws:
RoleRetrievalFault
-
getRole
- Parameters:
roleId-- Returns:
- Throws:
UserManagementSystemExceptionRoleRetrievalFault
-
getRole
- Parameters:
roleName-groupId- the LR groupId- Returns:
- an instance of
GCubeRoleif the roleName exists, null otherwise - Throws:
RoleRetrievalFault- if the roleName does not existGroupRetrievalFault- if the groupId does not exist
-
getRoleId
* @param roleName- Parameters:
groupId- the LR groupId- Returns:
- the LR RoleId if the roleName exists
- Throws:
RoleRetrievalFault- if the roleName does not existGroupRetrievalFault- if the groupId does not exist
-
getRoleIdByName
* @param roleName- Returns:
- the LR RoleId if the roleName exists
- Throws:
RoleRetrievalFault- if the roleName does not exist
-
listAllRoles
- Returns:
- a list of
GCubeRoleindependent from the roleType
-
listAllGroupRoles
- Returns:
- a list of
GCubeRoleof type Site Role (Type=2)
-
listRolesByUserAndGroup
List<GCubeRole> listRolesByUserAndGroup(long userId, long groupId) throws GroupRetrievalFault, UserRetrievalFault - Parameters:
groupId-userId-- Returns:
- a list of
GCubeRoleof type Site Role (Type=2) - Throws:
GroupRetrievalFault- if the group does not existUserRetrievalFault- if the user does not exist
-
createTeam
GCubeTeam createTeam(long creatorUserId, long groupId, String teamName, String teamDescription) throws GroupRetrievalFault, TeamRetrievalFault, UserManagementSystemException - Parameters:
creatorUserId- the username of who is creating the teamgroupId- the site group id where the team existsteamName- the name you want to assign to this teamteamDescription-- Returns:
- the GCubeTeam if the team is created succesfully, null otherwise
- Throws:
UserManagementSystemExceptionGroupRetrievalFaultTeamRetrievalFault
-
createTeam
GCubeTeam createTeam(long groupId, String teamName, String teamDescription) throws GroupRetrievalFault, TeamRetrievalFault, UserManagementSystemException it will crate the Team as Administrator, use the other method to pass the userId- Parameters:
groupId- the site group id where the team existsteamName- the name you want to assign to this teamteamDescription-- Returns:
- the GCubeTeam if the team is created succesfully, null otherwise
- Throws:
UserManagementSystemExceptionGroupRetrievalFaultTeamRetrievalFault
-
getTeam
- Parameters:
groupId-teamName-- Returns:
- Throws:
GroupRetrievalFaultTeamRetrievalFault
-
getTeam
- Parameters:
teamId-- Returns:
- the GCubeTeam istance
- Throws:
UserManagementSystemExceptionTeamRetrievalFault- if the team does not exist
-
deleteTeam
- Parameters:
teamId- the LR team Id- Returns:
- the team instance that was removed
- Throws:
UserManagementSystemExceptionTeamRetrievalFault- if the team does not exist
-
deleteTeams
- Parameters:
groupId- the LR GroupId of the Site- Returns:
- true if the teams are deleted succesfully, false otherwise
- Throws:
UserManagementSystemException
-
deleteUserTeams
delete a user from a list of teams- Parameters:
userId-teamIds-- Returns:
- Throws:
UserRetrievalFault- if the user does not existTeamRetrievalFault- if a team does not exist
-
deleteUserTeams
boolean deleteUserTeams(long userId, List<GCubeTeam> teams) throws UserRetrievalFault, TeamRetrievalFault delete a user from a list of teams- Parameters:
userId-teams-- Returns:
- Throws:
UserRetrievalFault- if the user does not existTeamRetrievalFault- if a team does not exist
-
updateTeam
GCubeTeam updateTeam(long teamId, String teamName, String teamDescription) throws TeamRetrievalFault - Parameters:
teamId- the team idteamName- the team nameteamDescription- the team description- Returns:
- the updated team
- Throws:
TeamRetrievalFault
-
setUserTeams
associate or not associate teams to a user- Parameters:
userId-teamIds-- Returns:
- Throws:
TeamRetrievalFault- if a system exception occurred or a team does not exists
-
assignTeamToUser
boolean assignTeamToUser(long userId, long teamId) throws UserManagementSystemException, UserRetrievalFault, GroupRetrievalFault, TeamRetrievalFault associate one team to the existing teams of user- Parameters:
userId-teamId-- Returns:
- Throws:
UserManagementSystemExceptionUserRetrievalFaultGroupRetrievalFaultTeamRetrievalFault
-
listTeamsByGroup
- Returns:
- a list of
GCubeTeambelonging to a give group - Throws:
GroupRetrievalFault
-
listTeamsByUserAndGroup
List<GCubeTeam> listTeamsByUserAndGroup(long userId, long groupId) throws UserRetrievalFault, GroupRetrievalFault - Parameters:
userId- the LR userId of the SitegroupId- the LR GroupId of the Site- Returns:
- a list of
GCubeTeambelonging to a user in a given group - Throws:
UserRetrievalFaultGroupRetrievalFault
-