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 TypeMethodDescriptionboolean
addGroupRole
(long groupId, long roleId) boolean
addGroupRole
(long groupId, Role role) boolean
addGroupRoles
(long groupId, long[] roleIds) boolean
addGroupRoles
(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) boolean
addUserRole
(long userId, long roleId) boolean
addUserRole
(long userId, Role role) boolean
addUserRoles
(long userId, long[] roleIds) boolean
addUserRoles
(long userId, List<Role> roles) void
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
clearGroupRoles
(long groupId) void
clearUserRoles
(long userId) createPersistedModel
(Serializable primaryKeyObj) createRole
(long roleId) Creates a new role with the primary key.void
deleteGroupRole
(long groupId, long roleId) void
deleteGroupRole
(long groupId, Role role) void
deleteGroupRoles
(long groupId, long[] roleIds) void
deleteGroupRoles
(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.void
deleteUserRole
(long userId, long roleId) void
deleteUserRole
(long userId, Role role) void
deleteUserRoles
(long userId, long[] roleIds) void
deleteUserRoles
(long userId, List<Role> roles) <T> T
dslQuery
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) int
dslQueryCount
(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.long
dynamicQueryCount
(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.long
dynamicQueryCount
(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.int
getAssigneesTotal
(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) int
getGroupRolesAndTeamRolesCount
(long companyId, String name, List<String> excludedNames, String title, String description, int[] types, long excludedTeamRoleId, long teamGroupId) int
getGroupRolesCount
(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) int
Returns the number of roles.getSubtypeRoles
(String subtype) Returns all the roles of the subtype.int
getSubtypeRolesCount
(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.int
getTypeRolesCount
(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) int
getUserGroupGroupRolesCount
(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) int
getUserRolesCount
(long userId) getUserTeamRoles
(long userId, long groupId) boolean
hasGroupRole
(long groupId, long roleId) boolean
hasGroupRoles
(long groupId) boolean
hasUserRole
(long userId, long roleId) boolean
hasUserRole
(long userId, long companyId, String name, boolean inherited) Returnstrue
if the user is associated with the named regular role.boolean
hasUserRoles
(long userId) boolean
hasUserRoles
(long userId, long companyId, String[] names, boolean inherited) Returnstrue
if 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.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.void
setGroupRoles
(long groupId, long[] roleIds) void
setUserRoles
(long userId, long[] roleIds) void
setWrappedService
(RoleLocalService roleLocalService) void
unsetUserRoles
(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) void
validateName
(String name) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
addGroupRole
in interfaceRoleLocalService
-
addGroupRole
- Specified by:
addGroupRole
in interfaceRoleLocalService
-
addGroupRoles
- Specified by:
addGroupRoles
in interfaceRoleLocalService
-
addGroupRoles
public boolean addGroupRoles(long groupId, long[] roleIds) - Specified by:
addGroupRoles
in 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:
addRole
in 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:
addRole
in interfaceRoleLocalService
- Throws:
PortalException
-
addUserRole
- Specified by:
addUserRole
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
addUserRole
- Specified by:
addUserRole
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
addUserRoles
- Specified by:
addUserRoles
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
addUserRoles
- Specified by:
addUserRoles
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
checkSystemRoles
Checks to ensure that the system roles map has appropriate default roles in each company.- Specified by:
checkSystemRoles
in interfaceRoleLocalService
- Throws:
PortalException
-
checkSystemRoles
Checks to ensure that the system roles map has appropriate default roles in the company.- Specified by:
checkSystemRoles
in interfaceRoleLocalService
- Parameters:
companyId
- the primary key of the company- Throws:
PortalException
-
clearGroupRoles
public void clearGroupRoles(long groupId) - Specified by:
clearGroupRoles
in interfaceRoleLocalService
-
clearUserRoles
- Specified by:
clearUserRoles
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
createPersistedModel
- Specified by:
createPersistedModel
in interfacePersistedModelLocalService
- Specified by:
createPersistedModel
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
createRole
Creates a new role with the primary key. Does not add the role to the database.- Specified by:
createRole
in interfaceRoleLocalService
- Parameters:
roleId
- the primary key for the new role- Returns:
- the new role
-
deleteGroupRole
public void deleteGroupRole(long groupId, long roleId) - Specified by:
deleteGroupRole
in interfaceRoleLocalService
-
deleteGroupRole
- Specified by:
deleteGroupRole
in interfaceRoleLocalService
-
deleteGroupRoles
- Specified by:
deleteGroupRoles
in interfaceRoleLocalService
-
deleteGroupRoles
public void deleteGroupRoles(long groupId, long[] roleIds) - Specified by:
deleteGroupRoles
in interfaceRoleLocalService
-
deletePersistedModel
- Specified by:
deletePersistedModel
in interfacePersistedModelLocalService
- Specified by:
deletePersistedModel
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
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:
deleteRole
in 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:
deleteRole
in interfaceRoleLocalService
- Parameters:
role
- the role- Returns:
- the role that was removed
- Throws:
PortalException
PortalException
-
deleteUserRole
- Specified by:
deleteUserRole
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
deleteUserRole
- Specified by:
deleteUserRole
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
deleteUserRoles
- Specified by:
deleteUserRoles
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
deleteUserRoles
- Specified by:
deleteUserRoles
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
dslQuery
public <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQuery
in interfacePersistedModelLocalService
- Specified by:
dslQuery
in interfaceRoleLocalService
-
dslQueryCount
public int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQueryCount
in interfacePersistedModelLocalService
- Specified by:
dslQueryCount
in interfaceRoleLocalService
-
dynamicQuery
- Specified by:
dynamicQuery
in interfaceRoleLocalService
-
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Specified by:
dynamicQuery
in 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 - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RoleModelImpl
.- Specified by:
dynamicQuery
in 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 - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RoleModelImpl
.- Specified by:
dynamicQuery
in 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:
dynamicQueryCount
in 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:
dynamicQueryCount
in 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:
fetchRole
in 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:
fetchRole
in interfaceRoleLocalService
- Parameters:
companyId
- the primary key of the companyname
- the role's name- Returns:
- Returns the role with the name or
null
if a role with the name could not be found in the company
-
fetchRoleByExternalReferenceCode
- Specified by:
fetchRoleByExternalReferenceCode
in interfaceRoleLocalService
-
fetchRoleByUuidAndCompanyId
Returns the role with the matching UUID and company.- Specified by:
fetchRoleByUuidAndCompanyId
in interfaceRoleLocalService
- Parameters:
uuid
- the role's UUIDcompanyId
- the primary key of the company- Returns:
- the matching role, or
null
if a matching role could not be found
-
getActionableDynamicQuery
- Specified by:
getActionableDynamicQuery
in interfaceRoleLocalService
-
getAssigneesTotal
- Specified by:
getAssigneesTotal
in 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:
getDefaultGroupRole
in 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:
getExportActionableDynamicQuery
in interfaceRoleLocalService
-
getGroupPrimaryKeys
public long[] getGroupPrimaryKeys(long roleId) Returns the groupIds of the groups associated with the role.- Specified by:
getGroupPrimaryKeys
in interfaceRoleLocalService
- Parameters:
roleId
- the roleId of the role- Returns:
- long[] the groupIds of groups associated with the role
-
getGroupRelatedRoles
- Specified by:
getGroupRelatedRoles
in interfaceRoleLocalService
- Throws:
PortalException
-
getGroupRoles
- Specified by:
getGroupRoles
in interfaceRoleLocalService
-
getGroupRoles
- Specified by:
getGroupRoles
in interfaceRoleLocalService
-
getGroupRoles
public List<Role> getGroupRoles(long groupId, int start, int end, OrderByComparator<Role> orderByComparator) - Specified by:
getGroupRoles
in 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:
getGroupRolesAndTeamRoles
in interfaceRoleLocalService
-
getGroupRolesAndTeamRolesCount
public int getGroupRolesAndTeamRolesCount(long companyId, String name, List<String> excludedNames, String title, String description, int[] types, long excludedTeamRoleId, long teamGroupId) - Specified by:
getGroupRolesAndTeamRolesCount
in interfaceRoleLocalService
-
getGroupRolesCount
public int getGroupRolesCount(long groupId) - Specified by:
getGroupRolesCount
in interfaceRoleLocalService
-
getIndexableActionableDynamicQuery
- Specified by:
getIndexableActionableDynamicQuery
in interfaceRoleLocalService
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Specified by:
getOSGiServiceIdentifier
in interfaceRoleLocalService
- Returns:
- the OSGi service identifier
-
getPersistedModel
- Specified by:
getPersistedModel
in interfacePersistedModelLocalService
- Specified by:
getPersistedModel
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
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:
getResourceRoles
in 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:
getResourceRoles
in 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:
getRole
in 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:
getRole
in 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:
getRoleByExternalReferenceCode
in interfaceRoleLocalService
- Throws:
PortalException
-
getRoleByUuidAndCompanyId
Returns the role with the matching UUID and company.- Specified by:
getRoleByUuidAndCompanyId
in 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 - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RoleModelImpl
.- Specified by:
getRoles
in 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:
getRoles
in 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:
getRoles
in 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:
getRoles
in interfaceRoleLocalService
- Parameters:
companyId
- the primary key of the companytypes
- the role types (optionallynull
)- Returns:
- the roles with the types
-
getRoles
- Specified by:
getRoles
in interfaceRoleLocalService
-
getRoles
Returns all the roles with the primary keys.- Specified by:
getRoles
in 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:
getRolesCount
in interfaceRoleLocalService
- Returns:
- the number of roles
-
getSubtypeRoles
Returns all the roles of the subtype.- Specified by:
getSubtypeRoles
in 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:
getSubtypeRolesCount
in 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:
getTeamRole
in 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:
getTeamRoleMap
in 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:
getTeamRoles
in 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:
getTeamRoles
in 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:
getTeamsRoles
in 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:
getTypeRoles
in 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:
getTypeRoles
in 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:
getTypeRolesCount
in 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:
getUserGroupGroupRoles
in 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:
getUserGroupGroupRoles
in interfaceRoleLocalService
-
getUserGroupGroupRolesCount
public int getUserGroupGroupRolesCount(long userId, long groupId) - Specified by:
getUserGroupGroupRolesCount
in interfaceRoleLocalService
-
getUserGroupRoles
Returns all the user's roles within the user group.- Specified by:
getUserGroupRoles
in 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:
getUserPrimaryKeys
in 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:
getUserRelatedRoles
in 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:
getUserRelatedRoles
in 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:
getUserRelatedRoles
in 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:
getUserRoles
in interfaceRoleLocalService
-
getUserRoles
- Specified by:
getUserRoles
in interfaceRoleLocalService
-
getUserRoles
public List<Role> getUserRoles(long userId, int start, int end, OrderByComparator<Role> orderByComparator) - Specified by:
getUserRoles
in interfaceRoleLocalService
-
getUserRolesCount
public int getUserRolesCount(long userId) - Specified by:
getUserRolesCount
in interfaceRoleLocalService
-
getUserTeamRoles
- Specified by:
getUserTeamRoles
in interfaceRoleLocalService
-
hasGroupRole
public boolean hasGroupRole(long groupId, long roleId) - Specified by:
hasGroupRole
in interfaceRoleLocalService
-
hasGroupRoles
public boolean hasGroupRoles(long groupId) - Specified by:
hasGroupRoles
in interfaceRoleLocalService
-
hasUserRole
public boolean hasUserRole(long userId, long roleId) - Specified by:
hasUserRole
in interfaceRoleLocalService
-
hasUserRole
public boolean hasUserRole(long userId, long companyId, String name, boolean inherited) throws PortalException Returnstrue
if the user is associated with the named regular role.- Specified by:
hasUserRole
in 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:
true
if the user is associated with the regular role;false
otherwise- Throws:
PortalException
-
hasUserRoles
public boolean hasUserRoles(long userId) - Specified by:
hasUserRoles
in interfaceRoleLocalService
-
hasUserRoles
public boolean hasUserRoles(long userId, long companyId, String[] names, boolean inherited) throws PortalException Returnstrue
if the user has any one of the named regular roles.- Specified by:
hasUserRoles
in 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:
true
if the user has any one of the regular roles;false
otherwise- 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 - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Specified by:
search
in 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 - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Specified by:
search
in 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, seeRoleFinder
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 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 - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Specified by:
search
in 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 - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Specified by:
search
in 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, seeRoleFinder
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:
-
searchCount
Returns the number of roles that match the keywords and types.- Specified by:
searchCount
in 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:
searchCount
in 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:
searchCount
in 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:
searchCount
in 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:
setGroupRoles
in interfaceRoleLocalService
-
setUserRoles
- Specified by:
setUserRoles
in interfaceRoleLocalService
- Throws:
PortalException
PortalException
-
unsetUserRoles
Removes the matching roles associated with the user. The user is reindexed after the roles are removed.- Specified by:
unsetUserRoles
in 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:
updateExternalReferenceCode
in interfaceRoleLocalService
- Throws:
PortalException
-
updateExternalReferenceCode
public Role updateExternalReferenceCode(Role role, String externalReferenceCode) throws PortalException - Specified by:
updateExternalReferenceCode
in 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:
updateRole
in 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:
updateRole
in interfaceRoleLocalService
- Parameters:
role
- the role- Returns:
- the role that was updated
-
validateName
- Specified by:
validateName
in interfaceRoleLocalService
- Throws:
PortalException
-
getBasePersistence
- Specified by:
getBasePersistence
in interfacePersistedModelLocalService
-
getCTPersistence
- Specified by:
getCTPersistence
in interfaceCTService<Role>
- Specified by:
getCTPersistence
in interfaceRoleLocalService
-
getModelClass
- Specified by:
getModelClass
in interfaceCTService<Role>
- Specified by:
getModelClass
in interfaceRoleLocalService
-
updateWithUnsafeFunction
public <R,E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<Role>, R, throws EE> updateUnsafeFunction) - Specified by:
updateWithUnsafeFunction
in interfaceCTService<Role>
- Specified by:
updateWithUnsafeFunction
in interfaceRoleLocalService
- Throws:
E extends Throwable
-
getWrappedService
- Specified by:
getWrappedService
in interfaceServiceWrapper<RoleLocalService>
-
setWrappedService
- Specified by:
setWrappedService
in interfaceServiceWrapper<RoleLocalService>
-