public class RoleLocalServiceImpl extends RoleLocalServiceBaseImpl
counterLocalService, groupPersistence, persistedModelLocalServiceRegistry, roleFinder, roleLocalService, rolePersistence, userPersistence
Constructor and Description |
---|
RoleLocalServiceImpl() |
Modifier and Type | Method and Description |
---|---|
com.liferay.portal.kernel.model.Role |
addRole(long userId,
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 with additional parameters.
|
void |
addUserRole(long userId,
long roleId)
Adds the role to the user.
|
void |
addUserRole(long userId,
com.liferay.portal.kernel.model.Role role)
Adds the role to the user.
|
void |
addUserRoles(long userId,
List<com.liferay.portal.kernel.model.Role> roles)
Adds the roles to the user.
|
void |
addUserRoles(long userId,
long[] roleIds)
Adds the roles to the user.
|
protected void |
checkSystemRole(Map<String,com.liferay.portal.kernel.model.Role> companyRolesMap,
long companyId,
String name,
Map<Locale,String> descriptionMap,
int type) |
void |
checkSystemRoles()
Checks to ensure that the system roles map has appropriate default roles
in each company.
|
void |
checkSystemRoles(long companyId)
Checks to ensure that the system roles map has appropriate default roles
in the company.
|
void |
clearUserRoles(long userId)
Removes every role from the user.
|
com.liferay.portal.kernel.model.Role |
deleteRole(long roleId)
Deletes the role with the primary key and its associated permissions.
|
com.liferay.portal.kernel.model.Role |
deleteRole(com.liferay.portal.kernel.model.Role role)
Deletes the role and its associated permissions.
|
void |
deleteUserRole(long userId,
long roleId)
Removes the role from the user.
|
void |
deleteUserRole(long userId,
com.liferay.portal.kernel.model.Role role)
Removes the role from the user.
|
void |
deleteUserRoles(long userId,
List<com.liferay.portal.kernel.model.Role> roles)
Removes the roles from the user.
|
void |
deleteUserRoles(long userId,
long[] roleIds)
Removes the roles from the user.
|
com.liferay.portal.kernel.model.Role |
fetchRole(long companyId,
String name)
Returns the role with the name in the company.
|
int |
getAssigneesTotal(long roleId) |
protected String[] |
getDefaultControlPanelPortlets() |
com.liferay.portal.kernel.model.Role |
getDefaultGroupRole(long groupId)
Returns the default role for the group with the primary key.
|
List<com.liferay.portal.kernel.model.Role> |
getGroupRelatedRoles(long groupId) |
List<com.liferay.portal.kernel.model.Role> |
getGroupRolesAndTeamRoles(long companyId,
String keywords,
List<String> excludedNames,
int[] types,
long excludedTeamRoleId,
long teamGroupId,
int start,
int end) |
int |
getGroupRolesAndTeamRolesCount(long companyId,
String keywords,
List<String> excludedNames,
int[] types,
long excludedTeamRoleId,
long teamGroupId) |
Map<String,List<String>> |
getResourceRoles(long companyId,
String name,
int scope,
String primKey)
Returns a map of role names to associated action IDs for the named
resource in the company within the permission scope.
|
List<com.liferay.portal.kernel.model.Role> |
getResourceRoles(long companyId,
String name,
int scope,
String primKey,
String actionId)
Returns all the roles associated with the action ID in the company within
the permission scope.
|
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)
Returns all the roles of the type and subtype.
|
List<com.liferay.portal.kernel.model.Role> |
getRoles(long companyId)
Returns all the roles in the company.
|
List<com.liferay.portal.kernel.model.Role> |
getRoles(long[] roleIds)
Returns all the roles with the primary keys.
|
List<com.liferay.portal.kernel.model.Role> |
getRoles(long companyId,
int[] types)
Returns all the roles with the types.
|
List<com.liferay.portal.kernel.model.Role> |
getRoles(long companyId,
long classNameId,
long[] classPKs,
int type) |
List<com.liferay.portal.kernel.model.Role> |
getSubtypeRoles(String subtype)
Returns all the roles of the subtype.
|
int |
getSubtypeRolesCount(String subtype)
Returns the number of roles of the subtype.
|
com.liferay.portal.kernel.model.Role |
getTeamRole(long companyId,
long teamId)
Returns the team role in the company.
|
Map<com.liferay.portal.kernel.model.Team,com.liferay.portal.kernel.model.Role> |
getTeamRoleMap(long groupId)
Returns the team role map for the group.
|
protected Map<com.liferay.portal.kernel.model.Team,com.liferay.portal.kernel.model.Role> |
getTeamRoleMap(long groupId,
long[] excludedRoleIds) |
List<com.liferay.portal.kernel.model.Role> |
getTeamRoles(long groupId)
Returns the team roles in the group.
|
List<com.liferay.portal.kernel.model.Role> |
getTeamRoles(long groupId,
long[] excludedRoleIds)
Returns the team roles in the group, excluding the specified role IDs.
|
List<com.liferay.portal.kernel.model.Role> |
getTeamsRoles(long companyId,
long[] teamIds)
Returns the team roles in the company.
|
List<com.liferay.portal.kernel.model.Role> |
getTypeRoles(int type)
Returns all the roles of the type.
|
List<com.liferay.portal.kernel.model.Role> |
getTypeRoles(int type,
int start,
int end)
Returns a range of all the roles of the type.
|
int |
getTypeRolesCount(int type)
Returns the number of roles of the type.
|
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> |
getUserGroupGroupRoles(long userId,
long groupId,
int start,
int end) |
int |
getUserGroupGroupRolesCount(long userId,
long groupId) |
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> |
getUserRelatedRoles(long userId,
long groupId)
Returns all the user's roles within the group.
|
List<com.liferay.portal.kernel.model.Role> |
getUserRelatedRoles(long userId,
long[] groupIds)
Returns the union of all the user's roles within the groups.
|
List<com.liferay.portal.kernel.model.Role> |
getUserTeamRoles(long userId,
long groupId) |
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. |
protected void |
initAnalyticsAdministratorViewPermissions(com.liferay.portal.kernel.model.Role role) |
protected void |
initPersonalControlPanelPortletsPermissions(com.liferay.portal.kernel.model.Role role) |
protected void |
initPublicationsUserViewPermissions(com.liferay.portal.kernel.model.Role role) |
protected void |
reindex(long userId) |
List<com.liferay.portal.kernel.model.Role> |
search(long companyId,
String keywords,
Integer[] types,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> orderByComparator)
Returns an ordered range of all the roles that match the keywords and
types.
|
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> orderByComparator)
Returns an ordered range of all the roles that match the keywords, types,
and params.
|
List<com.liferay.portal.kernel.model.Role> |
search(long companyId,
String name,
String description,
Integer[] types,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> orderByComparator)
Returns an ordered range of all the roles that match the name,
description, and types.
|
List<com.liferay.portal.kernel.model.Role> |
search(long companyId,
String name,
String description,
Integer[] types,
LinkedHashMap<String,Object> params,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> orderByComparator)
Returns an ordered range of all the roles that match the name,
description, types, and params.
|
int |
searchCount(long companyId,
String keywords,
Integer[] types)
Returns the number of roles that match the keywords and types.
|
int |
searchCount(long companyId,
String keywords,
Integer[] types,
LinkedHashMap<String,Object> params)
Returns the number of roles that match the keywords, types and params.
|
int |
searchCount(long companyId,
String name,
String description,
Integer[] types)
Returns the number of roles that match the name, description, and types.
|
int |
searchCount(long companyId,
String name,
String description,
Integer[] types,
LinkedHashMap<String,Object> params)
Returns the number of roles that match the name, description, types, and
params.
|
protected void |
setRolePermissions(com.liferay.portal.kernel.model.Role role,
String name,
String[] actionIds) |
void |
setUserRoles(long userId,
long[] roleIds)
Sets the roles associated with the user, replacing the user's existing
roles.
|
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.
|
protected void |
validate(long roleId,
long companyId,
long classNameId,
String name) |
void |
validateName(String name) |
addGroupRole, addGroupRole, addGroupRoles, addGroupRoles, addRole, afterPropertiesSet, clearGroupRoles, createPersistedModel, createRole, deleteGroupRole, deleteGroupRole, deleteGroupRoles, deleteGroupRoles, deletePersistedModel, destroy, dslQuery, dslQueryCount, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, dynamicQueryCount, fetchRole, fetchRoleByUuidAndCompanyId, getActionableDynamicQuery, getBasePersistence, getCounterLocalService, getCTPersistence, getExportActionableDynamicQuery, getGroupPrimaryKeys, getGroupRoles, getGroupRoles, getGroupRoles, getGroupRolesCount, getIndexableActionableDynamicQuery, getModelClass, getModelClassName, getOSGiServiceIdentifier, getPersistedModel, getRole, getRoleByUuidAndCompanyId, getRoleFinder, getRoleLocalService, getRolePersistence, getRoles, getRolesCount, getUserPrimaryKeys, getUserRoles, getUserRoles, getUserRoles, getUserRolesCount, hasGroupRole, hasGroupRoles, hasUserRole, hasUserRoles, initActionableDynamicQuery, runSQL, setCounterLocalService, setGroupRoles, setRoleFinder, setRoleLocalService, setRolePersistence, updateRole, updateWithUnsafeFunction
public com.liferay.portal.kernel.model.Role addRole(long userId, 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
userId
- the primary key of the userclassName
- the name of the class for which the role is created
(optionally null
)classPK
- 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 expando bridge attributes for the
role.com.liferay.portal.kernel.exception.PortalException
public void addUserRole(long userId, long roleId) throws com.liferay.portal.kernel.exception.PortalException
addUserRole
in interface com.liferay.portal.kernel.service.RoleLocalService
addUserRole
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userroleId
- the primary key of the rolecom.liferay.portal.kernel.exception.PortalException
UserPersistence.addRole(
long, long)
public void addUserRole(long userId, com.liferay.portal.kernel.model.Role role) throws com.liferay.portal.kernel.exception.PortalException
addUserRole
in interface com.liferay.portal.kernel.service.RoleLocalService
addUserRole
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userrole
- the rolecom.liferay.portal.kernel.exception.PortalException
UserPersistence.addRole(
long, Role)
public void addUserRoles(long userId, List<com.liferay.portal.kernel.model.Role> roles) throws com.liferay.portal.kernel.exception.PortalException
addUserRoles
in interface com.liferay.portal.kernel.service.RoleLocalService
addUserRoles
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userroles
- the rolescom.liferay.portal.kernel.exception.PortalException
UserPersistence.addRoles(
long, List)
public void addUserRoles(long userId, long[] roleIds) throws com.liferay.portal.kernel.exception.PortalException
addUserRoles
in interface com.liferay.portal.kernel.service.RoleLocalService
addUserRoles
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userroleIds
- the primary keys of the rolescom.liferay.portal.kernel.exception.PortalException
UserPersistence.addRoles(
long, long[])
public void checkSystemRoles() throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) public void checkSystemRoles(long companyId) throws com.liferay.portal.kernel.exception.PortalException
companyId
- the primary key of the companycom.liferay.portal.kernel.exception.PortalException
public void clearUserRoles(long userId) throws com.liferay.portal.kernel.exception.PortalException
clearUserRoles
in interface com.liferay.portal.kernel.service.RoleLocalService
clearUserRoles
in class RoleLocalServiceBaseImpl
userId
- the primary key of the usercom.liferay.portal.kernel.exception.PortalException
UserPersistence.clearRoles(
long)
public com.liferay.portal.kernel.model.Role deleteRole(long roleId) throws com.liferay.portal.kernel.exception.PortalException
deleteRole
in interface com.liferay.portal.kernel.service.RoleLocalService
deleteRole
in class RoleLocalServiceBaseImpl
roleId
- the primary key of the rolecom.liferay.portal.kernel.exception.PortalException
- if a role with the primary key could not be found@SystemEvent(action=1, type=1) public com.liferay.portal.kernel.model.Role deleteRole(com.liferay.portal.kernel.model.Role role) throws com.liferay.portal.kernel.exception.PortalException
deleteRole
in interface com.liferay.portal.kernel.service.RoleLocalService
deleteRole
in class RoleLocalServiceBaseImpl
role
- the rolecom.liferay.portal.kernel.exception.PortalException
public void deleteUserRole(long userId, long roleId) throws com.liferay.portal.kernel.exception.PortalException
deleteUserRole
in interface com.liferay.portal.kernel.service.RoleLocalService
deleteUserRole
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userroleId
- the primary key of the rolecom.liferay.portal.kernel.exception.PortalException
UserPersistence.removeRole(
long, long)
public void deleteUserRole(long userId, com.liferay.portal.kernel.model.Role role) throws com.liferay.portal.kernel.exception.PortalException
deleteUserRole
in interface com.liferay.portal.kernel.service.RoleLocalService
deleteUserRole
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userrole
- the rolecom.liferay.portal.kernel.exception.PortalException
UserPersistence.removeRole(
long, Role)
public void deleteUserRoles(long userId, List<com.liferay.portal.kernel.model.Role> roles) throws com.liferay.portal.kernel.exception.PortalException
deleteUserRoles
in interface com.liferay.portal.kernel.service.RoleLocalService
deleteUserRoles
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userroles
- the rolescom.liferay.portal.kernel.exception.PortalException
UserPersistence.removeRoles(
long, List)
public void deleteUserRoles(long userId, long[] roleIds) throws com.liferay.portal.kernel.exception.PortalException
deleteUserRoles
in interface com.liferay.portal.kernel.service.RoleLocalService
deleteUserRoles
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userroleIds
- the primary keys of the rolescom.liferay.portal.kernel.exception.PortalException
UserPersistence.removeRoles(
long, long[])
public com.liferay.portal.kernel.model.Role fetchRole(long companyId, String name)
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 namenull
if a role
with the name could not be found in the companypublic int getAssigneesTotal(long roleId) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Role getDefaultGroupRole(long groupId) throws com.liferay.portal.kernel.exception.PortalException
If the group is a site, then the default role is RoleConstants.SITE_MEMBER
. If the group is an organization, then the
default role is RoleConstants.ORGANIZATION_USER
. If the group is
a user or user group, then the default role is RoleConstants.POWER_USER
. For all other group types, the default role is
RoleConstants.USER
.
groupId
- the primary key of the groupcom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getGroupRelatedRoles(long groupId) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getGroupRolesAndTeamRoles(long companyId, String keywords, List<String> excludedNames, int[] types, long excludedTeamRoleId, long teamGroupId, int start, int end)
public int getGroupRolesAndTeamRolesCount(long companyId, String keywords, List<String> excludedNames, int[] types, long excludedTeamRoleId, long teamGroupId)
public Map<String,List<String>> getResourceRoles(long companyId, String name, int scope, String primKey)
companyId
- the primary key of the companyname
- the resource namescope
- the permission scopeprimKey
- the primary key of the resource's classpublic List<com.liferay.portal.kernel.model.Role> getResourceRoles(long companyId, String name, int scope, String primKey, String actionId)
companyId
- the primary key of the companyname
- the resource namescope
- the permission scopeprimKey
- the primary key of the resource's classactionId
- the name of the resource actionpublic 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 namecom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getRoles(int type, String subtype)
type
- the role's type (optionally 0
)subtype
- the role's subtype (optionally null
)public List<com.liferay.portal.kernel.model.Role> getRoles(long companyId)
companyId
- the primary key of the companypublic List<com.liferay.portal.kernel.model.Role> getRoles(long companyId, int[] types)
companyId
- the primary key of the companytypes
- the role types (optionally null
)public List<com.liferay.portal.kernel.model.Role> getRoles(long companyId, long classNameId, long[] classPKs, int type)
public List<com.liferay.portal.kernel.model.Role> getRoles(long[] roleIds) throws com.liferay.portal.kernel.exception.PortalException
roleIds
- the primary keys of the rolescom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getSubtypeRoles(String subtype)
subtype
- the role's subtype (optionally null
)public int getSubtypeRolesCount(String subtype)
subtype
- the role's subtype (optionally null
)public com.liferay.portal.kernel.model.Role getTeamRole(long companyId, long teamId) throws com.liferay.portal.kernel.exception.PortalException
companyId
- the primary key of the companyteamId
- the primary key of the teamcom.liferay.portal.kernel.exception.PortalException
public Map<com.liferay.portal.kernel.model.Team,com.liferay.portal.kernel.model.Role> getTeamRoleMap(long groupId) throws com.liferay.portal.kernel.exception.PortalException
groupId
- the primary key of the groupcom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getTeamRoles(long groupId) throws com.liferay.portal.kernel.exception.PortalException
groupId
- the primary key of the groupcom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getTeamRoles(long groupId, long[] excludedRoleIds) throws com.liferay.portal.kernel.exception.PortalException
groupId
- the primary key of the groupexcludedRoleIds
- the primary keys of the roles to exclude
(optionally null
)com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getTeamsRoles(long companyId, long[] teamIds) throws com.liferay.portal.kernel.exception.PortalException
companyId
- the primary key of the companyteamIds
- the primary keys of the teamscom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> getTypeRoles(int type)
type
- the role's type (optionally 0
)public List<com.liferay.portal.kernel.model.Role> getTypeRoles(int type, int start, int end)
type
- the role's type (optionally 0
)start
- the lower bound of the range of roles to returnend
- the upper bound of the range of roles to return (not
inclusive)public int getTypeRolesCount(int type)
type
- the role's type (optionally 0
)public List<com.liferay.portal.kernel.model.Role> getUserGroupGroupRoles(long userId, long groupId)
userId
- the primary key of the usergroupId
- the primary key of the grouppublic List<com.liferay.portal.kernel.model.Role> getUserGroupGroupRoles(long userId, long groupId, int start, int end)
public int getUserGroupGroupRolesCount(long userId, long groupId)
public List<com.liferay.portal.kernel.model.Role> getUserGroupRoles(long userId, long groupId)
userId
- the primary key of the usergroupId
- the primary key of the grouppublic List<com.liferay.portal.kernel.model.Role> getUserRelatedRoles(long userId, List<com.liferay.portal.kernel.model.Group> groups)
userId
- the primary key of the usergroups
- the groups (optionally null
)public List<com.liferay.portal.kernel.model.Role> getUserRelatedRoles(long userId, long groupId)
userId
- the primary key of the usergroupId
- the primary key of the grouppublic List<com.liferay.portal.kernel.model.Role> getUserRelatedRoles(long userId, long[] groupIds)
userId
- the primary key of the usergroupIds
- the primary keys of the groupspublic List<com.liferay.portal.kernel.model.Role> getUserTeamRoles(long userId, long groupId)
@ThreadLocalCachable 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
searchtrue
if the user is associated with the regular
role; false
otherwisecom.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
searchtrue
if the user has any one of the regular roles;
false
otherwisecom.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Role> search(long companyId, String keywords, Integer[] types, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> orderByComparator)
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil.ALL_POS
will return the full
result set.
companyId
- the primary key of the companykeywords
- the keywords (space separated), which may occur in the
role's name or description (optionally null
)types
- the role types (optionally null
)start
- the lower bound of the range of roles to returnend
- the upper bound of the range of roles to return (not
inclusive)orderByComparator
- the comparator to order the roles (optionally
null
)orderByComparator
RoleFinder
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> orderByComparator)
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil.ALL_POS
will return the full
result set.
companyId
- the primary key of the companykeywords
- the keywords (space separated), which may occur in the
role's name or description (optionally null
)types
- the role types (optionally null
)params
- the finder parameters. Can specify values for the
"usersRoles" key. For more information, see RoleFinder
start
- the lower bound of the range of roles to returnend
- the upper bound of the range of roles to return (not
inclusive)orderByComparator
- the comparator to order the roles (optionally
null
)orderByComparator
RoleFinder
public List<com.liferay.portal.kernel.model.Role> search(long companyId, String name, String description, Integer[] types, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> orderByComparator)
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil.ALL_POS
will return the full
result set.
companyId
- the primary key of the companyname
- the role's name (optionally null
)description
- the role's description (optionally null
)types
- the role types (optionally null
)start
- the lower bound of the range of the roles to returnend
- the upper bound of the range of the roles to return (not
inclusive)orderByComparator
- the comparator to order the roles (optionally
null
)orderByComparator
RoleFinder
public List<com.liferay.portal.kernel.model.Role> search(long companyId, String name, String description, Integer[] types, LinkedHashMap<String,Object> params, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> orderByComparator)
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil.ALL_POS
will return the full
result set.
companyId
- the primary key of the companyname
- the role's name (optionally null
)description
- the role's description (optionally null
)types
- the role types (optionally null
)params
- the finder's parameters. Can specify values for the
"usersRoles" key. For more information, see RoleFinder
start
- the lower bound of the range of the roles to returnend
- the upper bound of the range of the roles to return (not
inclusive)orderByComparator
- the comparator to order the roles (optionally
null
)orderByComparator
RoleFinder
public int searchCount(long companyId, String keywords, Integer[] types)
companyId
- the primary key of the companykeywords
- the keywords (space separated), which may occur in the
role's name or description (optionally null
)types
- the role types (optionally null
)public int searchCount(long companyId, String keywords, Integer[] types, LinkedHashMap<String,Object> params)
companyId
- the primary key of the companykeywords
- the keywords (space separated), which may occur in the
role's name or description (optionally null
)types
- the role types (optionally null
)params
- the finder parameters. For more information, see RoleFinder
public int searchCount(long companyId, String name, String description, Integer[] types)
companyId
- the primary key of the companyname
- the role's name (optionally null
)description
- the role's description (optionally null
)types
- the role types (optionally null
)public int searchCount(long companyId, String name, String description, Integer[] types, LinkedHashMap<String,Object> params)
companyId
- the primary key of the companyname
- the role's name (optionally null
)description
- the role's description (optionally null
)types
- the role types (optionally null
)params
- the finder parameters. Can specify values for the
"usersRoles" key. For more information, see RoleFinder
public void setUserRoles(long userId, long[] roleIds) throws com.liferay.portal.kernel.exception.PortalException
setUserRoles
in interface com.liferay.portal.kernel.service.RoleLocalService
setUserRoles
in class RoleLocalServiceBaseImpl
userId
- the primary key of the userroleIds
- the primary keys of the rolescom.liferay.portal.kernel.exception.PortalException
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 rolescom.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 expando bridge attributes for the
role.com.liferay.portal.kernel.exception.PortalException
public void validateName(String name) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void checkSystemRole(Map<String,com.liferay.portal.kernel.model.Role> companyRolesMap, long companyId, String name, Map<Locale,String> descriptionMap, int type) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected String[] getDefaultControlPanelPortlets()
protected Map<com.liferay.portal.kernel.model.Team,com.liferay.portal.kernel.model.Role> getTeamRoleMap(long groupId, long[] excludedRoleIds) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void initAnalyticsAdministratorViewPermissions(com.liferay.portal.kernel.model.Role role) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void initPersonalControlPanelPortletsPermissions(com.liferay.portal.kernel.model.Role role) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void initPublicationsUserViewPermissions(com.liferay.portal.kernel.model.Role role) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void reindex(long userId) throws com.liferay.portal.kernel.search.SearchException
com.liferay.portal.kernel.search.SearchException
protected void setRolePermissions(com.liferay.portal.kernel.model.Role role, String name, String[] actionIds) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
protected void validate(long roleId, long companyId, long classNameId, String name) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException