|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.liferay.portal.service.base.PrincipalBean
com.liferay.portal.service.base.RoleServiceBaseImpl
com.liferay.portal.service.impl.RoleServiceImpl
public class RoleServiceImpl
The implementation of the role remote service.
| Field Summary |
|---|
| Fields inherited from class com.liferay.portal.service.base.PrincipalBean |
|---|
ANONYMOUS_NAMES, JRUN_ANONYMOUS, ORACLE_ANONYMOUS, SUN_ANONYMOUS, WEBLOGIC_ANONYMOUS |
| Constructor Summary | |
|---|---|
RoleServiceImpl()
|
|
| Method Summary | |
|---|---|
com.liferay.portal.model.Role |
addRole(java.lang.String name,
java.util.Map<java.util.Locale,java.lang.String> titleMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
int type)
Adds a role. |
void |
addUserRoles(long userId,
long[] roleIds)
Adds the roles to the user. |
protected void |
checkUserRolesPermission(long userId,
long[] roleIds)
|
void |
deleteRole(long roleId)
Deletes the role with the primary key and its associated permissions. |
protected java.util.List<com.liferay.portal.model.Role> |
filterRoles(java.util.List<com.liferay.portal.model.Role> roles)
|
java.util.List<com.liferay.portal.model.Role> |
getGroupRoles(long groupId)
Returns all the roles associated with the group. |
com.liferay.portal.model.Role |
getRole(long roleId)
Returns the role with the primary key. |
com.liferay.portal.model.Role |
getRole(long companyId,
java.lang.String name)
Returns the role with the name in the company. |
java.util.List<com.liferay.portal.model.Role> |
getUserGroupGroupRoles(long userId,
long groupId)
Returns all the user's roles within the user group. |
java.util.List<com.liferay.portal.model.Role> |
getUserGroupRoles(long userId,
long groupId)
Returns all the user's roles within the user group. |
java.util.List<com.liferay.portal.model.Role> |
getUserRelatedRoles(long userId,
java.util.List<com.liferay.portal.model.Group> groups)
Returns the union of all the user's roles within the groups. |
java.util.List<com.liferay.portal.model.Role> |
getUserRoles(long userId)
Returns all the roles associated with the user. |
boolean |
hasUserRole(long userId,
long companyId,
java.lang.String name,
boolean inherited)
Returns true if the user is associated with the named
regular role. |
boolean |
hasUserRoles(long userId,
long companyId,
java.lang.String[] names,
boolean inherited)
Returns true if the user has any one of the named regular
roles. |
void |
unsetUserRoles(long userId,
long[] roleIds)
Removes the matching roles associated with the user. |
com.liferay.portal.model.Role |
updateRole(long roleId,
java.lang.String name,
java.util.Map<java.util.Locale,java.lang.String> titleMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
java.lang.String subtype)
Updates the role with the primary key. |
| Methods inherited from class com.liferay.portal.service.base.PrincipalBean |
|---|
getGuestOrUser, getGuestOrUserId, getPermissionChecker, getUser, getUserId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RoleServiceImpl()
| Method Detail |
|---|
public com.liferay.portal.model.Role addRole(java.lang.String name,
java.util.Map<java.util.Locale,java.lang.String> titleMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
int type)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
name - the role's nametitleMap - the role's localized titles (optionally
null)descriptionMap - the role's localized descriptions (optionally
null)type - the role's type (optionally 0)
com.liferay.portal.kernel.exception.PortalException - if a user with the primary key could not be
found, if the user did not have permission to add roles, if the
class name or the role name were invalid, or if the role is a
duplicate
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public void addUserRoles(long userId,
long[] roleIds)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the userroleIds - the primary keys of the roles
com.liferay.portal.kernel.exception.PortalException - if a user with the primary key could not be found
or if the user did not have permission to assign members to one
of the roles
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public void deleteRole(long roleId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
roleId - the primary key of the role
com.liferay.portal.kernel.exception.PortalException - if the user did not have permission to delete the
role, if a role with the primary key could not be found, if the
role is a default system role, or if the role's resource could
not be found
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public java.util.List<com.liferay.portal.model.Role> getGroupRoles(long groupId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the group
com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public com.liferay.portal.model.Role getRole(long roleId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
roleId - the primary key of the role
com.liferay.portal.kernel.exception.PortalException - if a role with the primary key could not be found
or if the user did not have permission to view the role
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public com.liferay.portal.model.Role getRole(long companyId,
java.lang.String name)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
The method searches the system roles map first for default roles. If a role with the name is not found, then the method will query the database.
companyId - the primary key of the companyname - the role's name
com.liferay.portal.kernel.exception.PortalException - if a role with the name could not be found in the
company or if the user did not have permission to view the role
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(long userId,
long groupId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the usergroupId - the primary key of the group
com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(long userId,
long groupId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the usergroupId - the primary key of the group
com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(long userId,
java.util.List<com.liferay.portal.model.Group> groups)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the usergroups - the groups (optionally null)
com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public java.util.List<com.liferay.portal.model.Role> getUserRoles(long userId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the user
com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public boolean hasUserRole(long userId,
long companyId,
java.lang.String name,
boolean inherited)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
true if the user is associated with the named
regular role.
userId - the primary key of the usercompanyId - the primary key of the companyname - the name of the roleinherited - whether to include the user's inherited roles in the
search
true if the user is associated with the regular
role; false otherwise
com.liferay.portal.kernel.exception.PortalException - if a role with the name could not be found in the
company or if a default user for the company could not be found
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public boolean hasUserRoles(long userId,
long companyId,
java.lang.String[] names,
boolean inherited)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
true if the user has any one of the named regular
roles.
userId - the primary key of the usercompanyId - the primary key of the companynames - the names of the rolesinherited - whether to include the user's inherited roles in the
search
true if the user has any one of the regular roles;
false otherwise
com.liferay.portal.kernel.exception.PortalException - if any one of the roles with the names could not
be found in the company or if the default user for the company
could not be found
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public void unsetUserRoles(long userId,
long[] roleIds)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the userroleIds - the primary keys of the roles
com.liferay.portal.kernel.exception.PortalException - if a user with the primary key could not be
found, if the user did not have permission to remove members from
a role, or if a role with any one of the primary keys could not
be found
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
public com.liferay.portal.model.Role updateRole(long roleId,
java.lang.String name,
java.util.Map<java.util.Locale,java.lang.String> titleMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
java.lang.String subtype)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
roleId - the primary key of the rolename - the role's new nametitleMap - the new localized titles (optionally null)
to replace those existing for the roledescriptionMap - the new localized descriptions (optionally
null) to replace those existing for the rolesubtype - the role's new subtype (optionally null)
com.liferay.portal.kernel.exception.PortalException - if the user did not have permission to update the
role, if a role with the primary could not be found, or if the
role's name was invalid
com.liferay.portal.kernel.exception.SystemException - if a system exception occurred
protected void checkUserRolesPermission(long userId,
long[] roleIds)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected java.util.List<com.liferay.portal.model.Role> filterRoles(java.util.List<com.liferay.portal.model.Role> roles)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||