|
Liferay 7.0-ce-b8 portal-impl | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.portal.kernel.service.BaseServiceImpl
com.liferay.portal.service.base.RoleServiceBaseImpl
com.liferay.portal.service.impl.RoleServiceImpl
public class RoleServiceImpl
Provides the remote service for accessing, adding, unassigning, checking, deleting, and updating roles. Its methods include permission checks.
| Field Summary |
|---|
| Fields inherited from class com.liferay.portal.kernel.service.BaseServiceImpl |
|---|
ANONYMOUS_NAMES, JRUN_ANONYMOUS, ORACLE_ANONYMOUS, SUN_ANONYMOUS, WEBLOGIC_ANONYMOUS |
| Constructor Summary | |
|---|---|
RoleServiceImpl()
|
|
| Method Summary | |
|---|---|
com.liferay.portal.kernel.model.Role |
addRole(String className,
long classPK,
String name,
Map<Locale,String> titleMap,
Map<Locale,String> descriptionMap,
int type,
String subtype,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
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. |
com.liferay.portal.kernel.model.Role |
fetchRole(long roleId)
|
protected List<com.liferay.portal.kernel.model.Role> |
filterRoles(List<com.liferay.portal.kernel.model.Role> roles)
|
List<com.liferay.portal.kernel.model.Role> |
getGroupRoles(long groupId)
Returns all the roles associated with the group. |
com.liferay.portal.kernel.model.Role |
getRole(long roleId)
Returns the role with the primary key. |
com.liferay.portal.kernel.model.Role |
getRole(long companyId,
String name)
Returns the role with the name in the company. |
List<com.liferay.portal.kernel.model.Role> |
getRoles(int type,
String subtype)
|
List<com.liferay.portal.kernel.model.Role> |
getRoles(long companyId,
int[] types)
|
List<com.liferay.portal.kernel.model.Role> |
getUserGroupGroupRoles(long userId,
long groupId)
Returns all the user's roles within the user group. |
List<com.liferay.portal.kernel.model.Role> |
getUserGroupRoles(long userId,
long groupId)
Returns all the user's roles within the user group. |
List<com.liferay.portal.kernel.model.Role> |
getUserRelatedRoles(long userId,
List<com.liferay.portal.kernel.model.Group> groups)
Returns the union of all the user's roles within the groups. |
List<com.liferay.portal.kernel.model.Role> |
getUserRoles(long userId)
Returns all the roles associated with the user. |
boolean |
hasUserRole(long userId,
long companyId,
String name,
boolean inherited)
Returns true if the user is associated with the named
regular role. |
boolean |
hasUserRoles(long userId,
long companyId,
String[] names,
boolean inherited)
Returns true if the user has any one of the named regular
roles. |
List<com.liferay.portal.kernel.model.Role> |
search(long companyId,
String keywords,
Integer[] types,
LinkedHashMap<String,Object> params,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> obc)
|
int |
searchCount(long companyId,
String keywords,
Integer[] types,
LinkedHashMap<String,Object> params)
|
void |
unsetUserRoles(long userId,
long[] roleIds)
Removes the matching roles associated with the user. |
com.liferay.portal.kernel.model.Role |
updateRole(long roleId,
String name,
Map<Locale,String> titleMap,
Map<Locale,String> descriptionMap,
String subtype,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
Updates the role with the primary key. |
| Methods inherited from class com.liferay.portal.kernel.service.BaseServiceImpl |
|---|
getClassLoader, 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.kernel.model.Role addRole(String className,
long classPK,
String name,
Map<Locale,String> titleMap,
Map<Locale,String> descriptionMap,
int type,
String subtype,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException
className - the name of the class for which the role is createdclassPK - the primary key of the class for which the role is
created (optionally 0)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)subtype - the role's subtype (optionally null)serviceContext - the service context to be applied (optionally
null). Can set the expando bridge attributes for the
role.
com.liferay.portal.kernel.exception.PortalException
public void addUserRoles(long userId,
long[] roleIds)
throws com.liferay.portal.kernel.exception.PortalException
userId - the primary key of the userroleIds - the primary keys of the roles
com.liferay.portal.kernel.exception.PortalException
public void deleteRole(long roleId)
throws com.liferay.portal.kernel.exception.PortalException
roleId - the primary key of the role
com.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Role fetchRole(long roleId)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getGroupRoles(long groupId)
throws com.liferay.portal.kernel.exception.PortalException
groupId - the primary key of the group
com.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Role getRole(long roleId)
throws com.liferay.portal.kernel.exception.PortalException
roleId - the primary key of the role
com.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Role getRole(long companyId,
String name)
throws com.liferay.portal.kernel.exception.PortalException
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
public List<com.liferay.portal.kernel.model.Role> getRoles(int type,
String subtype)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getRoles(long companyId,
int[] types)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getUserGroupGroupRoles(long userId,
long groupId)
throws com.liferay.portal.kernel.exception.PortalException
userId - the primary key of the usergroupId - the primary key of the group
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getUserGroupRoles(long userId,
long groupId)
throws com.liferay.portal.kernel.exception.PortalException
userId - the primary key of the usergroupId - the primary key of the group
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getUserRelatedRoles(long userId,
List<com.liferay.portal.kernel.model.Group> groups)
throws com.liferay.portal.kernel.exception.PortalException
userId - the primary key of the usergroups - the groups (optionally null)
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getUserRoles(long userId)
throws com.liferay.portal.kernel.exception.PortalException
userId - the primary key of the user
com.liferay.portal.kernel.exception.PortalException
public boolean hasUserRole(long userId,
long companyId,
String name,
boolean inherited)
throws com.liferay.portal.kernel.exception.PortalException
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
public boolean hasUserRoles(long userId,
long companyId,
String[] names,
boolean inherited)
throws com.liferay.portal.kernel.exception.PortalException
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
public List<com.liferay.portal.kernel.model.Role> search(long companyId,
String keywords,
Integer[] types,
LinkedHashMap<String,Object> params,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> obc)
public int searchCount(long companyId,
String keywords,
Integer[] types,
LinkedHashMap<String,Object> params)
public void unsetUserRoles(long userId,
long[] roleIds)
throws com.liferay.portal.kernel.exception.PortalException
userId - the primary key of the userroleIds - the primary keys of the roles
com.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Role updateRole(long roleId,
String name,
Map<Locale,String> titleMap,
Map<Locale,String> descriptionMap,
String subtype,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException
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)serviceContext - the service context to be applied (optionally
null). Can set the expando bridge attributes for the
role.
com.liferay.portal.kernel.exception.PortalException
protected void checkUserRolesPermission(long userId,
long[] roleIds)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected List<com.liferay.portal.kernel.model.Role> filterRoles(List<com.liferay.portal.kernel.model.Role> roles)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
|
Liferay 7.0-ce-b8 portal-impl | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||