added RemoceAllRolesFromuser method
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vo-management/usermanagement-core@126046 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
dfa3fdfad8
commit
0ae9bd353b
|
@ -74,6 +74,17 @@ public interface RoleManager {
|
|||
* @throws RoleRetrievalFault
|
||||
*/
|
||||
boolean removeRoleFromUser(long userId, long groupId, long roleId) throws UserManagementSystemException, UserRetrievalFault, GroupRetrievalFault,RoleRetrievalFault;
|
||||
/**
|
||||
*
|
||||
* @param userId
|
||||
* @param groupIds
|
||||
* @return
|
||||
* @throws UserManagementSystemException
|
||||
* @throws UserRetrievalFault
|
||||
* @throws GroupRetrievalFault
|
||||
*/
|
||||
boolean removeAllRolesFromUser(long userId, long... groupIds) throws UserManagementSystemException, UserRetrievalFault, GroupRetrievalFault;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param roleId
|
||||
|
|
|
@ -249,6 +249,22 @@ public class LiferayRoleManager implements RoleManager {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean removeAllRolesFromUser(long userId, long... groupIds) throws UserManagementSystemException, UserRetrievalFault, GroupRetrievalFault {
|
||||
try {
|
||||
_log.debug("Trying to remove all roles to " + UserLocalServiceUtil.getUser(userId).getFullName() +" in groups " + groupIds);
|
||||
UserGroupRoleLocalServiceUtil.deleteUserGroupRoles(userId, groupIds);
|
||||
return true;
|
||||
} catch (PortalException e) {
|
||||
throw new UserRetrievalFault("User, not existing, or group/roleId could not be found", e);
|
||||
} catch (SystemException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<GCubeRole> listAllRoles() {
|
||||
List<GCubeRole> toReturn = new ArrayList<GCubeRole>();
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue