Class RoleLocalServiceWrapper
- All Implemented Interfaces:
BaseLocalService,CTService<Role>,PersistedModelLocalService,RoleLocalService,ServiceWrapper<RoleLocalService>
RoleLocalService.- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddGroupRole(long groupId, long roleId) booleanaddGroupRole(long groupId, Role role) booleanaddGroupRoles(long groupId, long[] roleIds) booleanaddGroupRoles(long groupId, List<Role> roles) Adds the role to the database.addRole(String externalReferenceCode, long userId, String className, long classPK, String name, Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, int type, String subtype, ServiceContext serviceContext) booleanaddUserRole(long userId, long roleId) booleanaddUserRole(long userId, Role role) booleanaddUserRoles(long userId, long[] roleIds) booleanaddUserRoles(long userId, List<Role> roles) voidChecks to ensure that the system roles map has appropriate default roles in each company.voidcheckSystemRoles(long companyId) Checks to ensure that the system roles map has appropriate default roles in the company.voidclearGroupRoles(long groupId) voidclearUserRoles(long userId) createPersistedModel(Serializable primaryKeyObj) createRole(long roleId) Creates a new role with the primary key.voiddeleteGroupRole(long groupId, long roleId) voiddeleteGroupRole(long groupId, Role role) voiddeleteGroupRoles(long groupId, long[] roleIds) voiddeleteGroupRoles(long groupId, List<Role> roles) deletePersistedModel(PersistedModel persistedModel) deleteRole(long roleId) Deletes the role with the primary key from the database.deleteRole(Role role) Deletes the role from the database.voiddeleteUserRole(long userId, long roleId) voiddeleteUserRole(long userId, Role role) voiddeleteUserRoles(long userId, long[] roleIds) voiddeleteUserRoles(long userId, List<Role> roles) <T> TdslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) intdslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) <T> List<T>dynamicQuery(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.<T> List<T>dynamicQuery(DynamicQuery dynamicQuery, int start, int end) Performs a dynamic query on the database and returns a range of the matching rows.<T> List<T>dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.longdynamicQueryCount(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.longdynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.fetchRole(long roleId) Returns the role with the name in the company.fetchRoleByExternalReferenceCode(String externalReferenceCode, long companyId) fetchRoleByUuidAndCompanyId(String uuid, long companyId) Returns the role with the matching UUID and company.intgetAssigneesTotal(long roleId) getDefaultGroupRole(long groupId) Returns the default role for the group with the primary key.getExportActionableDynamicQuery(PortletDataContext portletDataContext) long[]getGroupPrimaryKeys(long roleId) Returns the groupIds of the groups associated with the role.getGroupRelatedRoles(long groupId) getGroupRoles(long groupId) getGroupRoles(long groupId, int start, int end) getGroupRoles(long groupId, int start, int end, OrderByComparator<Role> orderByComparator) getGroupRolesAndTeamRoles(long companyId, String name, List<String> excludedNames, String title, String description, int[] types, long excludedTeamRoleId, long teamGroupId, int start, int end) intgetGroupRolesAndTeamRolesCount(long companyId, String name, List<String> excludedNames, String title, String description, int[] types, long excludedTeamRoleId, long teamGroupId) intgetGroupRolesCount(long groupId) Returns the OSGi service identifier.getPersistedModel(Serializable primaryKeyObj) 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.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.getRole(long roleId) Returns the role with the primary key.Returns the role with the name in the company.getRoleByExternalReferenceCode(String externalReferenceCode, long companyId) getRoleByUuidAndCompanyId(String uuid, long companyId) Returns the role with the matching UUID and company.getRoles(int start, int end) Returns a range of all the roles.Returns all the roles of the type and subtype.getRoles(long companyId) Returns all the roles in the company.getRoles(long[] roleIds) Returns all the roles with the primary keys.getRoles(long companyId, int[] types) Returns all the roles with the types.getRoles(long companyId, long classNameId, long[] classPKs, int type) intReturns the number of roles.getSubtypeRoles(String subtype) Returns all the roles of the subtype.intgetSubtypeRolesCount(String subtype) Returns the number of roles of the subtype.getTeamRole(long companyId, long teamId) Returns the team role in the company.getTeamRoleMap(long groupId) Returns the team role map for the group.getTeamRoles(long groupId) Returns the team roles in the group.getTeamRoles(long groupId, long[] excludedRoleIds) Returns the team roles in the group, excluding the specified role IDs.getTeamsRoles(long companyId, long[] teamIds) Returns the team roles in the company.getTypeRoles(int type) Returns all the roles of the type.getTypeRoles(int type, int start, int end) Returns a range of all the roles of the type.intgetTypeRolesCount(int type) Returns the number of roles of the type.getUserGroupGroupRoles(long userId, long groupId) Returns all the user's roles within the user group.getUserGroupGroupRoles(long userId, long groupId, int start, int end) intgetUserGroupGroupRolesCount(long userId, long groupId) getUserGroupRoles(long userId, long groupId) Returns all the user's roles within the user group.long[]getUserPrimaryKeys(long roleId) Returns the userIds of the users associated with the role.getUserRelatedRoles(long userId, long groupId) Returns all the user's roles within the group.getUserRelatedRoles(long userId, long[] groupIds) Returns the union of all the user's roles within the groups.getUserRelatedRoles(long userId, List<Group> groups) Returns the union of all the user's roles within the groups.getUserRoles(long userId) getUserRoles(long userId, int start, int end) getUserRoles(long userId, int start, int end, OrderByComparator<Role> orderByComparator) intgetUserRolesCount(long userId) getUserTeamRoles(long userId, long groupId) booleanhasGroupRole(long groupId, long roleId) booleanhasGroupRoles(long groupId) booleanhasUserRole(long userId, long roleId) booleanhasUserRole(long userId, long companyId, String name, boolean inherited) Returnstrueif the user is associated with the named regular role.booleanhasUserRoles(long userId) booleanhasUserRoles(long userId, long companyId, String[] names, boolean inherited) Returnstrueif the user has any one of the named regular roles.search(long companyId, String keywords, Integer[] types, int start, int end, OrderByComparator<Role> orderByComparator) Returns an ordered range of all the roles that match the keywords and types.search(long companyId, String keywords, Integer[] types, LinkedHashMap<String, Object> params, int start, int end, OrderByComparator<Role> orderByComparator) Returns an ordered range of all the roles that match the keywords, types, and params.search(long companyId, String name, String description, Integer[] types, int start, int end, OrderByComparator<Role> orderByComparator) Returns an ordered range of all the roles that match the name, description, and types.search(long companyId, String name, String description, Integer[] types, LinkedHashMap<String, Object> params, int start, int end, OrderByComparator<Role> orderByComparator) Returns an ordered range of all the roles that match the name, description, types, and params.intsearchCount(long companyId, String keywords, Integer[] types) Returns the number of roles that match the keywords and types.intsearchCount(long companyId, String keywords, Integer[] types, LinkedHashMap<String, Object> params) Returns the number of roles that match the keywords, types and params.intsearchCount(long companyId, String name, String description, Integer[] types) Returns the number of roles that match the name, description, and types.intsearchCount(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.voidsetGroupRoles(long groupId, long[] roleIds) voidsetUserRoles(long userId, long[] roleIds) voidsetWrappedService(RoleLocalService roleLocalService) voidunsetUserRoles(long userId, long[] roleIds) Removes the matching roles associated with the user.updateExternalReferenceCode(long roleId, String externalReferenceCode) updateExternalReferenceCode(Role role, String externalReferenceCode) updateRole(long roleId, String name, Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, String subtype, ServiceContext serviceContext) Updates the role with the primary key.updateRole(Role role) Updates the role in the database or adds it if it does not yet exist.<R,E extends Throwable>
RupdateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<Role>, R, E> updateUnsafeFunction) voidvalidateName(String name) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.liferay.portal.kernel.service.PersistedModelLocalService
fetchPersistedModel
-
Constructor Details
-
RoleLocalServiceWrapper
public RoleLocalServiceWrapper() -
RoleLocalServiceWrapper
-
-
Method Details
-
addGroupRole
public boolean addGroupRole(long groupId, long roleId) - Specified by:
addGroupRolein interfaceRoleLocalService
-
addGroupRole
- Specified by:
addGroupRolein interfaceRoleLocalService
-
addGroupRoles
- Specified by:
addGroupRolesin interfaceRoleLocalService
-
addGroupRoles
public boolean addGroupRoles(long groupId, long[] roleIds) - Specified by:
addGroupRolesin interfaceRoleLocalService
-
addRole
Adds the role to the database. Also notifies the appropriate model listeners.Important: Inspect RoleLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Specified by:
addRolein interfaceRoleLocalService- Parameters:
role- the role- Returns:
- the role that was added
-
addRole
public Role addRole(String externalReferenceCode, long userId, String className, long classPK, String name, Map<Locale, String> titleMap, Map<Locale, throws PortalExceptionString> descriptionMap, int type, String subtype, ServiceContext serviceContext) - Specified by:
addRolein interfaceRoleLocalService- Throws:
PortalException
-
addUserRole
- Specified by:
addUserRolein interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
addUserRole
- Specified by:
addUserRolein interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
addUserRoles
- Specified by:
addUserRolesin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
addUserRoles
- Specified by:
addUserRolesin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
checkSystemRoles
Checks to ensure that the system roles map has appropriate default roles in each company.- Specified by:
checkSystemRolesin interfaceRoleLocalService- Throws:
PortalException
-
checkSystemRoles
Checks to ensure that the system roles map has appropriate default roles in the company.- Specified by:
checkSystemRolesin interfaceRoleLocalService- Parameters:
companyId- the primary key of the company- Throws:
PortalException
-
clearGroupRoles
public void clearGroupRoles(long groupId) - Specified by:
clearGroupRolesin interfaceRoleLocalService
-
clearUserRoles
- Specified by:
clearUserRolesin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
createPersistedModel
- Specified by:
createPersistedModelin interfacePersistedModelLocalService- Specified by:
createPersistedModelin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
createRole
Creates a new role with the primary key. Does not add the role to the database.- Specified by:
createRolein interfaceRoleLocalService- Parameters:
roleId- the primary key for the new role- Returns:
- the new role
-
deleteGroupRole
public void deleteGroupRole(long groupId, long roleId) - Specified by:
deleteGroupRolein interfaceRoleLocalService
-
deleteGroupRole
- Specified by:
deleteGroupRolein interfaceRoleLocalService
-
deleteGroupRoles
- Specified by:
deleteGroupRolesin interfaceRoleLocalService
-
deleteGroupRoles
public void deleteGroupRoles(long groupId, long[] roleIds) - Specified by:
deleteGroupRolesin interfaceRoleLocalService
-
deletePersistedModel
- Specified by:
deletePersistedModelin interfacePersistedModelLocalService- Specified by:
deletePersistedModelin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
deleteRole
Deletes the role with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect RoleLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Specified by:
deleteRolein interfaceRoleLocalService- Parameters:
roleId- the primary key of the role- Returns:
- the role that was removed
- Throws:
PortalException- if a role with the primary key could not be foundPortalException
-
deleteRole
Deletes the role from the database. Also notifies the appropriate model listeners.Important: Inspect RoleLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Specified by:
deleteRolein interfaceRoleLocalService- Parameters:
role- the role- Returns:
- the role that was removed
- Throws:
PortalExceptionPortalException
-
deleteUserRole
- Specified by:
deleteUserRolein interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
deleteUserRole
- Specified by:
deleteUserRolein interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
deleteUserRoles
- Specified by:
deleteUserRolesin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
deleteUserRoles
- Specified by:
deleteUserRolesin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
dslQuery
public <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQueryin interfacePersistedModelLocalService- Specified by:
dslQueryin interfaceRoleLocalService
-
dslQueryCount
public int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQueryCountin interfacePersistedModelLocalService- Specified by:
dslQueryCountin interfaceRoleLocalService
-
dynamicQuery
- Specified by:
dynamicQueryin interfaceRoleLocalService
-
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Specified by:
dynamicQueryin interfaceRoleLocalService- Parameters:
dynamicQuery- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
Performs a dynamic query on the database and returns a range of the matching rows.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RoleModelImpl.- Specified by:
dynamicQueryin interfaceRoleLocalService- Parameters:
dynamicQuery- the dynamic querystart- the lower bound of the range of model instancesend- the upper bound of the range of model instances (not inclusive)- Returns:
- the range of matching rows
-
dynamicQuery
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RoleModelImpl.- Specified by:
dynamicQueryin interfaceRoleLocalService- Parameters:
dynamicQuery- the dynamic querystart- the lower bound of the range of model instancesend- the upper bound of the range of model instances (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Specified by:
dynamicQueryCountin interfaceRoleLocalService- Parameters:
dynamicQuery- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Specified by:
dynamicQueryCountin interfaceRoleLocalService- Parameters:
dynamicQuery- the dynamic queryprojection- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchRole
- Specified by:
fetchRolein interfaceRoleLocalService
-
fetchRole
Returns the role with the name in the company.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.
- Specified by:
fetchRolein interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyname- the role's name- Returns:
- Returns the role with the name or
nullif a role with the name could not be found in the company
-
fetchRoleByExternalReferenceCode
- Specified by:
fetchRoleByExternalReferenceCodein interfaceRoleLocalService
-
fetchRoleByUuidAndCompanyId
Returns the role with the matching UUID and company.- Specified by:
fetchRoleByUuidAndCompanyIdin interfaceRoleLocalService- Parameters:
uuid- the role's UUIDcompanyId- the primary key of the company- Returns:
- the matching role, or
nullif a matching role could not be found
-
getActionableDynamicQuery
- Specified by:
getActionableDynamicQueryin interfaceRoleLocalService
-
getAssigneesTotal
- Specified by:
getAssigneesTotalin interfaceRoleLocalService- Throws:
PortalException
-
getDefaultGroupRole
Returns the default role for the group with the primary key.If the group is a site, then the default role is
RoleConstants#SITE_MEMBER. If the group is an organization, then the default role isRoleConstants#ORGANIZATION_USER. If the group is a user or user group, then the default role isRoleConstants#POWER_USER. For all other group types, the default role isRoleConstants#USER.- Specified by:
getDefaultGroupRolein interfaceRoleLocalService- Parameters:
groupId- the primary key of the group- Returns:
- the default role for the group with the primary key
- Throws:
PortalException
-
getExportActionableDynamicQuery
public ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext) - Specified by:
getExportActionableDynamicQueryin interfaceRoleLocalService
-
getGroupPrimaryKeys
public long[] getGroupPrimaryKeys(long roleId) Returns the groupIds of the groups associated with the role.- Specified by:
getGroupPrimaryKeysin interfaceRoleLocalService- Parameters:
roleId- the roleId of the role- Returns:
- long[] the groupIds of groups associated with the role
-
getGroupRelatedRoles
- Specified by:
getGroupRelatedRolesin interfaceRoleLocalService- Throws:
PortalException
-
getGroupRoles
- Specified by:
getGroupRolesin interfaceRoleLocalService
-
getGroupRoles
- Specified by:
getGroupRolesin interfaceRoleLocalService
-
getGroupRoles
public List<Role> getGroupRoles(long groupId, int start, int end, OrderByComparator<Role> orderByComparator) - Specified by:
getGroupRolesin interfaceRoleLocalService
-
getGroupRolesAndTeamRoles
public List<Role> getGroupRolesAndTeamRoles(long companyId, String name, List<String> excludedNames, String title, String description, int[] types, long excludedTeamRoleId, long teamGroupId, int start, int end) - Specified by:
getGroupRolesAndTeamRolesin interfaceRoleLocalService
-
getGroupRolesAndTeamRolesCount
public int getGroupRolesAndTeamRolesCount(long companyId, String name, List<String> excludedNames, String title, String description, int[] types, long excludedTeamRoleId, long teamGroupId) - Specified by:
getGroupRolesAndTeamRolesCountin interfaceRoleLocalService
-
getGroupRolesCount
public int getGroupRolesCount(long groupId) - Specified by:
getGroupRolesCountin interfaceRoleLocalService
-
getIndexableActionableDynamicQuery
- Specified by:
getIndexableActionableDynamicQueryin interfaceRoleLocalService
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Specified by:
getOSGiServiceIdentifierin interfaceRoleLocalService- Returns:
- the OSGi service identifier
-
getPersistedModel
- Specified by:
getPersistedModelin interfacePersistedModelLocalService- Specified by:
getPersistedModelin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
getResourceRoles
public 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.- Specified by:
getResourceRolesin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyname- the resource namescope- the permission scopeprimKey- the primary key of the resource's class- Returns:
- the role names and action IDs
-
getResourceRoles
public List<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.- Specified by:
getResourceRolesin interfaceRoleLocalService- Parameters:
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 action- Returns:
- the roles
-
getRole
Returns the role with the primary key.- Specified by:
getRolein interfaceRoleLocalService- Parameters:
roleId- the primary key of the role- Returns:
- the role
- Throws:
PortalException- if a role with the primary key could not be foundPortalException
-
getRole
Returns the role with the name in the company.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.
- Specified by:
getRolein interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyname- the role's name- Returns:
- the role with the name
- Throws:
PortalException
-
getRoleByExternalReferenceCode
public Role getRoleByExternalReferenceCode(String externalReferenceCode, long companyId) throws PortalException - Specified by:
getRoleByExternalReferenceCodein interfaceRoleLocalService- Throws:
PortalException
-
getRoleByUuidAndCompanyId
Returns the role with the matching UUID and company.- Specified by:
getRoleByUuidAndCompanyIdin interfaceRoleLocalService- Parameters:
uuid- the role's UUIDcompanyId- the primary key of the company- Returns:
- the matching role
- Throws:
PortalException- if a matching role could not be foundPortalException
-
getRoles
Returns a range of all the roles.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RoleModelImpl.- Specified by:
getRolesin interfaceRoleLocalService- Parameters:
start- the lower bound of the range of rolesend- the upper bound of the range of roles (not inclusive)- Returns:
- the range of roles
-
getRoles
Returns all the roles of the type and subtype.- Specified by:
getRolesin interfaceRoleLocalService- Parameters:
type- the role's type (optionally0)subtype- the role's subtype (optionallynull)- Returns:
- the roles of the type and subtype
-
getRoles
Returns all the roles in the company.- Specified by:
getRolesin interfaceRoleLocalService- Parameters:
companyId- the primary key of the company- Returns:
- the roles in the company
-
getRoles
Returns all the roles with the types.- Specified by:
getRolesin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companytypes- the role types (optionallynull)- Returns:
- the roles with the types
-
getRoles
- Specified by:
getRolesin interfaceRoleLocalService
-
getRoles
Returns all the roles with the primary keys.- Specified by:
getRolesin interfaceRoleLocalService- Parameters:
roleIds- the primary keys of the roles- Returns:
- the roles with the primary keys
- Throws:
PortalException
-
getRolesCount
public int getRolesCount()Returns the number of roles.- Specified by:
getRolesCountin interfaceRoleLocalService- Returns:
- the number of roles
-
getSubtypeRoles
Returns all the roles of the subtype.- Specified by:
getSubtypeRolesin interfaceRoleLocalService- Parameters:
subtype- the role's subtype (optionallynull)- Returns:
- the roles of the subtype
-
getSubtypeRolesCount
Returns the number of roles of the subtype.- Specified by:
getSubtypeRolesCountin interfaceRoleLocalService- Parameters:
subtype- the role's subtype (optionallynull)- Returns:
- the number of roles of the subtype
-
getTeamRole
Returns the team role in the company.- Specified by:
getTeamRolein interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyteamId- the primary key of the team- Returns:
- the team role in the company
- Throws:
PortalException
-
getTeamRoleMap
Returns the team role map for the group.- Specified by:
getTeamRoleMapin interfaceRoleLocalService- Parameters:
groupId- the primary key of the group- Returns:
- the team role map for the group
- Throws:
PortalException
-
getTeamRoles
Returns the team roles in the group.- Specified by:
getTeamRolesin interfaceRoleLocalService- Parameters:
groupId- the primary key of the group- Returns:
- the team roles in the group
- Throws:
PortalException
-
getTeamRoles
Returns the team roles in the group, excluding the specified role IDs.- Specified by:
getTeamRolesin interfaceRoleLocalService- Parameters:
groupId- the primary key of the groupexcludedRoleIds- the primary keys of the roles to exclude (optionallynull)- Returns:
- the team roles in the group, excluding the specified role IDs
- Throws:
PortalException
-
getTeamsRoles
Returns the team roles in the company.- Specified by:
getTeamsRolesin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyteamIds- the primary keys of the teams- Returns:
- the team roles in the company
- Throws:
PortalException
-
getTypeRoles
Returns all the roles of the type.- Specified by:
getTypeRolesin interfaceRoleLocalService- Parameters:
type- the role's type (optionally0)- Returns:
- the range of the roles of the type
-
getTypeRoles
Returns a range of all the roles of the type.- Specified by:
getTypeRolesin interfaceRoleLocalService- Parameters:
type- the role's type (optionally0)start- the lower bound of the range of roles to returnend- the upper bound of the range of roles to return (not inclusive)- Returns:
- the range of the roles of the type
-
getTypeRolesCount
public int getTypeRolesCount(int type) Returns the number of roles of the type.- Specified by:
getTypeRolesCountin interfaceRoleLocalService- Parameters:
type- the role's type (optionally0)- Returns:
- the number of roles of the type
-
getUserGroupGroupRoles
Returns all the user's roles within the user group.- Specified by:
getUserGroupGroupRolesin interfaceRoleLocalService- Parameters:
userId- the primary key of the usergroupId- the primary key of the group- Returns:
- the user's roles within the user group
-
getUserGroupGroupRoles
- Specified by:
getUserGroupGroupRolesin interfaceRoleLocalService
-
getUserGroupGroupRolesCount
public int getUserGroupGroupRolesCount(long userId, long groupId) - Specified by:
getUserGroupGroupRolesCountin interfaceRoleLocalService
-
getUserGroupRoles
Returns all the user's roles within the user group.- Specified by:
getUserGroupRolesin interfaceRoleLocalService- Parameters:
userId- the primary key of the usergroupId- the primary key of the group- Returns:
- the user's roles within the user group
-
getUserPrimaryKeys
public long[] getUserPrimaryKeys(long roleId) Returns the userIds of the users associated with the role.- Specified by:
getUserPrimaryKeysin interfaceRoleLocalService- Parameters:
roleId- the roleId of the role- Returns:
- long[] the userIds of users associated with the role
-
getUserRelatedRoles
Returns the union of all the user's roles within the groups. If no groups are provided, only the user's directly assigned roles are returned.- Specified by:
getUserRelatedRolesin interfaceRoleLocalService- Parameters:
userId- the primary key of the usergroups- the groups (optionallynull)- Returns:
- the union of all the user's roles within the groups
-
getUserRelatedRoles
Returns all the user's roles within the group.- Specified by:
getUserRelatedRolesin interfaceRoleLocalService- Parameters:
userId- the primary key of the usergroupId- the primary key of the group- Returns:
- the user's roles within the group
-
getUserRelatedRoles
Returns the union of all the user's roles within the groups. If no groupIds are provided, only the user's directly assigned roles are returned.- Specified by:
getUserRelatedRolesin interfaceRoleLocalService- Parameters:
userId- the primary key of the usergroupIds- the primary keys of the groups- Returns:
- the union of all the user's roles within the groups
-
getUserRoles
- Specified by:
getUserRolesin interfaceRoleLocalService
-
getUserRoles
- Specified by:
getUserRolesin interfaceRoleLocalService
-
getUserRoles
public List<Role> getUserRoles(long userId, int start, int end, OrderByComparator<Role> orderByComparator) - Specified by:
getUserRolesin interfaceRoleLocalService
-
getUserRolesCount
public int getUserRolesCount(long userId) - Specified by:
getUserRolesCountin interfaceRoleLocalService
-
getUserTeamRoles
- Specified by:
getUserTeamRolesin interfaceRoleLocalService
-
hasGroupRole
public boolean hasGroupRole(long groupId, long roleId) - Specified by:
hasGroupRolein interfaceRoleLocalService
-
hasGroupRoles
public boolean hasGroupRoles(long groupId) - Specified by:
hasGroupRolesin interfaceRoleLocalService
-
hasUserRole
public boolean hasUserRole(long userId, long roleId) - Specified by:
hasUserRolein interfaceRoleLocalService
-
hasUserRole
public boolean hasUserRole(long userId, long companyId, String name, boolean inherited) throws PortalException Returnstrueif the user is associated with the named regular role.- Specified by:
hasUserRolein interfaceRoleLocalService- Parameters:
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- Returns:
trueif the user is associated with the regular role;falseotherwise- Throws:
PortalException
-
hasUserRoles
public boolean hasUserRoles(long userId) - Specified by:
hasUserRolesin interfaceRoleLocalService
-
hasUserRoles
public boolean hasUserRoles(long userId, long companyId, String[] names, boolean inherited) throws PortalException Returnstrueif the user has any one of the named regular roles.- Specified by:
hasUserRolesin interfaceRoleLocalService- Parameters:
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- Returns:
trueif the user has any one of the regular roles;falseotherwise- Throws:
PortalException
-
search
public List<Role> search(long companyId, String keywords, Integer[] types, int start, int end, OrderByComparator<Role> orderByComparator) Returns an ordered range of all the roles that match the keywords and types.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set.- Specified by:
searchin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companykeywords- the keywords (space separated), which may occur in the role's name or description (optionallynull)types- the role types (optionallynull)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 (optionallynull)- Returns:
- the ordered range of the matching roles, ordered by
orderByComparator - See Also:
-
search
public List<Role> search(long companyId, String keywords, Integer[] types, LinkedHashMap<String, Object> params, int start, int end, OrderByComparator<Role> orderByComparator) Returns an ordered range of all the roles that match the keywords, types, and params.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set.- Specified by:
searchin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companykeywords- the keywords (space separated), which may occur in the role's name or description (optionallynull)types- the role types (optionallynull)params- the finder parameters. Can specify values for the "usersRoles" key. For more information, seeRoleFinderstart- 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 (optionallynull)- Returns:
- the ordered range of the matching roles, ordered by
orderByComparator - See Also:
-
search
public List<Role> search(long companyId, String name, String description, Integer[] types, int start, int end, OrderByComparator<Role> orderByComparator) Returns an ordered range of all the roles that match the name, description, and types.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set.- Specified by:
searchin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyname- the role's name (optionallynull)description- the role's description (optionallynull)types- the role types (optionallynull)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 (optionallynull)- Returns:
- the ordered range of the matching roles, ordered by
orderByComparator - See Also:
-
search
public List<Role> search(long companyId, String name, String description, Integer[] types, LinkedHashMap<String, Object> params, int start, int end, OrderByComparator<Role> orderByComparator) Returns an ordered range of all the roles that match the name, description, types, and params.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set.- Specified by:
searchin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyname- the role's name (optionallynull)description- the role's description (optionallynull)types- the role types (optionallynull)params- the finder's parameters. Can specify values for the "usersRoles" key. For more information, seeRoleFinderstart- 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 (optionallynull)- Returns:
- the ordered range of the matching roles, ordered by
orderByComparator - See Also:
-
searchCount
Returns the number of roles that match the keywords and types.- Specified by:
searchCountin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companykeywords- the keywords (space separated), which may occur in the role's name or description (optionallynull)types- the role types (optionallynull)- Returns:
- the number of matching roles
-
searchCount
public int searchCount(long companyId, String keywords, Integer[] types, LinkedHashMap<String, Object> params) Returns the number of roles that match the keywords, types and params.- Specified by:
searchCountin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companykeywords- the keywords (space separated), which may occur in the role's name or description (optionallynull)types- the role types (optionallynull)params- the finder parameters. For more information, seeRoleFinder- Returns:
- the number of matching roles
-
searchCount
Returns the number of roles that match the name, description, and types.- Specified by:
searchCountin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyname- the role's name (optionallynull)description- the role's description (optionallynull)types- the role types (optionallynull)- Returns:
- the number of matching roles
-
searchCount
public 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.- Specified by:
searchCountin interfaceRoleLocalService- Parameters:
companyId- the primary key of the companyname- the role's name (optionallynull)description- the role's description (optionallynull)types- the role types (optionallynull)params- the finder parameters. Can specify values for the "usersRoles" key. For more information, seeRoleFinder- Returns:
- the number of matching roles
-
setGroupRoles
public void setGroupRoles(long groupId, long[] roleIds) - Specified by:
setGroupRolesin interfaceRoleLocalService
-
setUserRoles
- Specified by:
setUserRolesin interfaceRoleLocalService- Throws:
PortalExceptionPortalException
-
unsetUserRoles
Removes the matching roles associated with the user. The user is reindexed after the roles are removed.- Specified by:
unsetUserRolesin interfaceRoleLocalService- Parameters:
userId- the primary key of the userroleIds- the primary keys of the roles- Throws:
PortalException
-
updateExternalReferenceCode
public Role updateExternalReferenceCode(long roleId, String externalReferenceCode) throws PortalException - Specified by:
updateExternalReferenceCodein interfaceRoleLocalService- Throws:
PortalException
-
updateExternalReferenceCode
public Role updateExternalReferenceCode(Role role, String externalReferenceCode) throws PortalException - Specified by:
updateExternalReferenceCodein interfaceRoleLocalService- Throws:
PortalException
-
updateRole
public Role updateRole(long roleId, String name, Map<Locale, String> titleMap, Map<Locale, throws PortalExceptionString> descriptionMap, String subtype, ServiceContext serviceContext) Updates the role with the primary key.- Specified by:
updateRolein interfaceRoleLocalService- Parameters:
roleId- the primary key of the rolename- the role's new nametitleMap- the new localized titles (optionallynull) to replace those existing for the roledescriptionMap- the new localized descriptions (optionallynull) to replace those existing for the rolesubtype- the role's new subtype (optionallynull)serviceContext- the service context to be applied (optionallynull). Can set expando bridge attributes for the role.- Returns:
- the role with the primary key
- Throws:
PortalException
-
updateRole
Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect RoleLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Specified by:
updateRolein interfaceRoleLocalService- Parameters:
role- the role- Returns:
- the role that was updated
-
validateName
- Specified by:
validateNamein interfaceRoleLocalService- Throws:
PortalException
-
getBasePersistence
- Specified by:
getBasePersistencein interfacePersistedModelLocalService
-
getCTPersistence
- Specified by:
getCTPersistencein interfaceCTService<Role>- Specified by:
getCTPersistencein interfaceRoleLocalService
-
getModelClass
- Specified by:
getModelClassin interfaceCTService<Role>- Specified by:
getModelClassin interfaceRoleLocalService
-
updateWithUnsafeFunction
public <R,E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<Role>, R, throws EE> updateUnsafeFunction) - Specified by:
updateWithUnsafeFunctionin interfaceCTService<Role>- Specified by:
updateWithUnsafeFunctionin interfaceRoleLocalService- Throws:
E extends Throwable
-
getWrappedService
- Specified by:
getWrappedServicein interfaceServiceWrapper<RoleLocalService>
-
setWrappedService
- Specified by:
setWrappedServicein interfaceServiceWrapper<RoleLocalService>
-