Class RoleLocalServiceWrapper

Object
com.liferay.portal.kernel.service.RoleLocalServiceWrapper
All Implemented Interfaces:
BaseLocalService, CTService<Role>, PersistedModelLocalService, RoleLocalService, ServiceWrapper<RoleLocalService>

public class RoleLocalServiceWrapper extends Object implements RoleLocalService, ServiceWrapper<RoleLocalService>
Provides a wrapper for RoleLocalService.
Author:
Brian Wing Shun Chan
See Also:
{$generated.description}
  • Constructor Details

    • RoleLocalServiceWrapper

      public RoleLocalServiceWrapper()
    • RoleLocalServiceWrapper

      public RoleLocalServiceWrapper(RoleLocalService roleLocalService)
  • Method Details

    • addGroupRole

      public boolean addGroupRole(long groupId, long roleId)
      Specified by:
      addGroupRole in interface RoleLocalService
    • addGroupRole

      public boolean addGroupRole(long groupId, Role role)
      Specified by:
      addGroupRole in interface RoleLocalService
    • addGroupRoles

      public boolean addGroupRoles(long groupId, List<Role> roles)
      Specified by:
      addGroupRoles in interface RoleLocalService
    • addGroupRoles

      public boolean addGroupRoles(long groupId, long[] roleIds)
      Specified by:
      addGroupRoles in interface RoleLocalService
    • addRole

      public Role addRole(Role role)
      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 interface RoleLocalService
      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,String> descriptionMap, int type, String subtype, ServiceContext serviceContext) throws PortalException
      Specified by:
      addRole in interface RoleLocalService
      Throws:
      PortalException
    • addUserRole

      public boolean addUserRole(long userId, long roleId) throws PortalException
      Specified by:
      addUserRole in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • addUserRole

      public boolean addUserRole(long userId, Role role) throws PortalException
      Specified by:
      addUserRole in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • addUserRoles

      public boolean addUserRoles(long userId, List<Role> roles) throws PortalException
      Specified by:
      addUserRoles in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • addUserRoles

      public boolean addUserRoles(long userId, long[] roleIds) throws PortalException
      Specified by:
      addUserRoles in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • checkSystemRoles

      public void checkSystemRoles() throws PortalException
      Checks to ensure that the system roles map has appropriate default roles in each company.
      Specified by:
      checkSystemRoles in interface RoleLocalService
      Throws:
      PortalException
    • checkSystemRoles

      public void checkSystemRoles(long companyId) throws PortalException
      Checks to ensure that the system roles map has appropriate default roles in the company.
      Specified by:
      checkSystemRoles in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      Throws:
      PortalException
    • clearGroupRoles

      public void clearGroupRoles(long groupId)
      Specified by:
      clearGroupRoles in interface RoleLocalService
    • clearUserRoles

      public void clearUserRoles(long userId) throws PortalException
      Specified by:
      clearUserRoles in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • createPersistedModel

      public PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      createPersistedModel in interface PersistedModelLocalService
      Specified by:
      createPersistedModel in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • createRole

      public Role createRole(long roleId)
      Creates a new role with the primary key. Does not add the role to the database.
      Specified by:
      createRole in interface RoleLocalService
      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 interface RoleLocalService
    • deleteGroupRole

      public void deleteGroupRole(long groupId, Role role)
      Specified by:
      deleteGroupRole in interface RoleLocalService
    • deleteGroupRoles

      public void deleteGroupRoles(long groupId, List<Role> roles)
      Specified by:
      deleteGroupRoles in interface RoleLocalService
    • deleteGroupRoles

      public void deleteGroupRoles(long groupId, long[] roleIds)
      Specified by:
      deleteGroupRoles in interface RoleLocalService
    • deletePersistedModel

      public PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
      Specified by:
      deletePersistedModel in interface PersistedModelLocalService
      Specified by:
      deletePersistedModel in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • deleteRole

      public Role deleteRole(long roleId) throws PortalException
      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 interface RoleLocalService
      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 found
      PortalException
    • deleteRole

      public Role deleteRole(Role role) throws PortalException
      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 interface RoleLocalService
      Parameters:
      role - the role
      Returns:
      the role that was removed
      Throws:
      PortalException
      PortalException
    • deleteUserRole

      public void deleteUserRole(long userId, long roleId) throws PortalException
      Specified by:
      deleteUserRole in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • deleteUserRole

      public void deleteUserRole(long userId, Role role) throws PortalException
      Specified by:
      deleteUserRole in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • deleteUserRoles

      public void deleteUserRoles(long userId, List<Role> roles) throws PortalException
      Specified by:
      deleteUserRoles in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • deleteUserRoles

      public void deleteUserRoles(long userId, long[] roleIds) throws PortalException
      Specified by:
      deleteUserRoles in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • dslQuery

      public <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQuery in interface PersistedModelLocalService
      Specified by:
      dslQuery in interface RoleLocalService
    • dslQueryCount

      public int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQueryCount in interface PersistedModelLocalService
      Specified by:
      dslQueryCount in interface RoleLocalService
    • dynamicQuery

      public DynamicQuery dynamicQuery()
      Specified by:
      dynamicQuery in interface RoleLocalService
    • dynamicQuery

      public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Specified by:
      dynamicQuery in interface RoleLocalService
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      public <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.

      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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RoleModelImpl.

      Specified by:
      dynamicQuery in interface RoleLocalService
      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - 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 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RoleModelImpl.

      Specified by:
      dynamicQuery in interface RoleLocalService
      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      public long dynamicQueryCount(DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Specified by:
      dynamicQueryCount in interface RoleLocalService
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
      Returns the number of rows matching the dynamic query.
      Specified by:
      dynamicQueryCount in interface RoleLocalService
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchRole

      public Role fetchRole(long roleId)
      Specified by:
      fetchRole in interface RoleLocalService
    • fetchRole

      public Role fetchRole(long companyId, String name)
      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 interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      name - 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

      public Role fetchRoleByExternalReferenceCode(String externalReferenceCode, long companyId)
      Specified by:
      fetchRoleByExternalReferenceCode in interface RoleLocalService
    • fetchRoleByUuidAndCompanyId

      public Role fetchRoleByUuidAndCompanyId(String uuid, long companyId)
      Returns the role with the matching UUID and company.
      Specified by:
      fetchRoleByUuidAndCompanyId in interface RoleLocalService
      Parameters:
      uuid - the role's UUID
      companyId - the primary key of the company
      Returns:
      the matching role, or null if a matching role could not be found
    • getActionableDynamicQuery

      public ActionableDynamicQuery getActionableDynamicQuery()
      Specified by:
      getActionableDynamicQuery in interface RoleLocalService
    • getAssigneesTotal

      public int getAssigneesTotal(long roleId) throws PortalException
      Specified by:
      getAssigneesTotal in interface RoleLocalService
      Throws:
      PortalException
    • getDefaultGroupRole

      public Role getDefaultGroupRole(long groupId) throws PortalException
      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 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.

      Specified by:
      getDefaultGroupRole in interface RoleLocalService
      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 interface RoleLocalService
    • getGroupPrimaryKeys

      public long[] getGroupPrimaryKeys(long roleId)
      Returns the groupIds of the groups associated with the role.
      Specified by:
      getGroupPrimaryKeys in interface RoleLocalService
      Parameters:
      roleId - the roleId of the role
      Returns:
      long[] the groupIds of groups associated with the role
    • getGroupRelatedRoles

      public List<Role> getGroupRelatedRoles(long groupId) throws PortalException
      Specified by:
      getGroupRelatedRoles in interface RoleLocalService
      Throws:
      PortalException
    • getGroupRoles

      public List<Role> getGroupRoles(long groupId)
      Specified by:
      getGroupRoles in interface RoleLocalService
    • getGroupRoles

      public List<Role> getGroupRoles(long groupId, int start, int end)
      Specified by:
      getGroupRoles in interface RoleLocalService
    • getGroupRoles

      public List<Role> getGroupRoles(long groupId, int start, int end, OrderByComparator<Role> orderByComparator)
      Specified by:
      getGroupRoles in interface RoleLocalService
    • 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 interface RoleLocalService
    • 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 interface RoleLocalService
    • getGroupRolesCount

      public int getGroupRolesCount(long groupId)
      Specified by:
      getGroupRolesCount in interface RoleLocalService
    • getIndexableActionableDynamicQuery

      public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
      Specified by:
      getIndexableActionableDynamicQuery in interface RoleLocalService
    • getOSGiServiceIdentifier

      public String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Specified by:
      getOSGiServiceIdentifier in interface RoleLocalService
      Returns:
      the OSGi service identifier
    • getPersistedModel

      public PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      getPersistedModel in interface PersistedModelLocalService
      Specified by:
      getPersistedModel in interface RoleLocalService
      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 interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      name - the resource name
      scope - the permission scope
      primKey - 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 interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      name - the resource name
      scope - the permission scope
      primKey - the primary key of the resource's class
      actionId - the name of the resource action
      Returns:
      the roles
    • getRole

      public Role getRole(long roleId) throws PortalException
      Returns the role with the primary key.
      Specified by:
      getRole in interface RoleLocalService
      Parameters:
      roleId - the primary key of the role
      Returns:
      the role
      Throws:
      PortalException - if a role with the primary key could not be found
      PortalException
    • getRole

      public Role getRole(long companyId, String name) throws PortalException
      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 interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      name - 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 interface RoleLocalService
      Throws:
      PortalException
    • getRoleByUuidAndCompanyId

      public Role getRoleByUuidAndCompanyId(String uuid, long companyId) throws PortalException
      Returns the role with the matching UUID and company.
      Specified by:
      getRoleByUuidAndCompanyId in interface RoleLocalService
      Parameters:
      uuid - the role's UUID
      companyId - the primary key of the company
      Returns:
      the matching role
      Throws:
      PortalException - if a matching role could not be found
      PortalException
    • getRoles

      public List<Role> getRoles(int start, int end)
      Returns a range of all the roles.

      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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RoleModelImpl.

      Specified by:
      getRoles in interface RoleLocalService
      Parameters:
      start - the lower bound of the range of roles
      end - the upper bound of the range of roles (not inclusive)
      Returns:
      the range of roles
    • getRoles

      public List<Role> getRoles(int type, String subtype)
      Returns all the roles of the type and subtype.
      Specified by:
      getRoles in interface RoleLocalService
      Parameters:
      type - the role's type (optionally 0)
      subtype - the role's subtype (optionally null)
      Returns:
      the roles of the type and subtype
    • getRoles

      public List<Role> getRoles(long companyId)
      Returns all the roles in the company.
      Specified by:
      getRoles in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      Returns:
      the roles in the company
    • getRoles

      public List<Role> getRoles(long companyId, int[] types)
      Returns all the roles with the types.
      Specified by:
      getRoles in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      types - the role types (optionally null)
      Returns:
      the roles with the types
    • getRoles

      public List<Role> getRoles(long companyId, long classNameId, long[] classPKs, int type)
      Specified by:
      getRoles in interface RoleLocalService
    • getRoles

      public List<Role> getRoles(long[] roleIds) throws PortalException
      Returns all the roles with the primary keys.
      Specified by:
      getRoles in interface RoleLocalService
      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 interface RoleLocalService
      Returns:
      the number of roles
    • getSubtypeRoles

      public List<Role> getSubtypeRoles(String subtype)
      Returns all the roles of the subtype.
      Specified by:
      getSubtypeRoles in interface RoleLocalService
      Parameters:
      subtype - the role's subtype (optionally null)
      Returns:
      the roles of the subtype
    • getSubtypeRolesCount

      public int getSubtypeRolesCount(String subtype)
      Returns the number of roles of the subtype.
      Specified by:
      getSubtypeRolesCount in interface RoleLocalService
      Parameters:
      subtype - the role's subtype (optionally null)
      Returns:
      the number of roles of the subtype
    • getTeamRole

      public Role getTeamRole(long companyId, long teamId) throws PortalException
      Returns the team role in the company.
      Specified by:
      getTeamRole in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      teamId - the primary key of the team
      Returns:
      the team role in the company
      Throws:
      PortalException
    • getTeamRoleMap

      public Map<Team,Role> getTeamRoleMap(long groupId) throws PortalException
      Returns the team role map for the group.
      Specified by:
      getTeamRoleMap in interface RoleLocalService
      Parameters:
      groupId - the primary key of the group
      Returns:
      the team role map for the group
      Throws:
      PortalException
    • getTeamRoles

      public List<Role> getTeamRoles(long groupId) throws PortalException
      Returns the team roles in the group.
      Specified by:
      getTeamRoles in interface RoleLocalService
      Parameters:
      groupId - the primary key of the group
      Returns:
      the team roles in the group
      Throws:
      PortalException
    • getTeamRoles

      public List<Role> getTeamRoles(long groupId, long[] excludedRoleIds) throws PortalException
      Returns the team roles in the group, excluding the specified role IDs.
      Specified by:
      getTeamRoles in interface RoleLocalService
      Parameters:
      groupId - the primary key of the group
      excludedRoleIds - the primary keys of the roles to exclude (optionally null)
      Returns:
      the team roles in the group, excluding the specified role IDs
      Throws:
      PortalException
    • getTeamsRoles

      public List<Role> getTeamsRoles(long companyId, long[] teamIds) throws PortalException
      Returns the team roles in the company.
      Specified by:
      getTeamsRoles in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      teamIds - the primary keys of the teams
      Returns:
      the team roles in the company
      Throws:
      PortalException
    • getTypeRoles

      public List<Role> getTypeRoles(int type)
      Returns all the roles of the type.
      Specified by:
      getTypeRoles in interface RoleLocalService
      Parameters:
      type - the role's type (optionally 0)
      Returns:
      the range of the roles of the type
    • getTypeRoles

      public List<Role> getTypeRoles(int type, int start, int end)
      Returns a range of all the roles of the type.
      Specified by:
      getTypeRoles in interface RoleLocalService
      Parameters:
      type - the role's type (optionally 0)
      start - the lower bound of the range of roles to return
      end - 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 interface RoleLocalService
      Parameters:
      type - the role's type (optionally 0)
      Returns:
      the number of roles of the type
    • getUserGroupGroupRoles

      public List<Role> getUserGroupGroupRoles(long userId, long groupId)
      Returns all the user's roles within the user group.
      Specified by:
      getUserGroupGroupRoles in interface RoleLocalService
      Parameters:
      userId - the primary key of the user
      groupId - the primary key of the group
      Returns:
      the user's roles within the user group
    • getUserGroupGroupRoles

      public List<Role> getUserGroupGroupRoles(long userId, long groupId, int start, int end)
      Specified by:
      getUserGroupGroupRoles in interface RoleLocalService
    • getUserGroupGroupRolesCount

      public int getUserGroupGroupRolesCount(long userId, long groupId)
      Specified by:
      getUserGroupGroupRolesCount in interface RoleLocalService
    • getUserGroupRoles

      public List<Role> getUserGroupRoles(long userId, long groupId)
      Returns all the user's roles within the user group.
      Specified by:
      getUserGroupRoles in interface RoleLocalService
      Parameters:
      userId - the primary key of the user
      groupId - 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 interface RoleLocalService
      Parameters:
      roleId - the roleId of the role
      Returns:
      long[] the userIds of users associated with the role
    • getUserRelatedRoles

      public List<Role> getUserRelatedRoles(long userId, List<Group> groups)
      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 interface RoleLocalService
      Parameters:
      userId - the primary key of the user
      groups - the groups (optionally null)
      Returns:
      the union of all the user's roles within the groups
    • getUserRelatedRoles

      public List<Role> getUserRelatedRoles(long userId, long groupId)
      Returns all the user's roles within the group.
      Specified by:
      getUserRelatedRoles in interface RoleLocalService
      Parameters:
      userId - the primary key of the user
      groupId - the primary key of the group
      Returns:
      the user's roles within the group
    • getUserRelatedRoles

      public List<Role> getUserRelatedRoles(long userId, long[] groupIds)
      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 interface RoleLocalService
      Parameters:
      userId - the primary key of the user
      groupIds - the primary keys of the groups
      Returns:
      the union of all the user's roles within the groups
    • getUserRoles

      public List<Role> getUserRoles(long userId)
      Specified by:
      getUserRoles in interface RoleLocalService
    • getUserRoles

      public List<Role> getUserRoles(long userId, int start, int end)
      Specified by:
      getUserRoles in interface RoleLocalService
    • getUserRoles

      public List<Role> getUserRoles(long userId, int start, int end, OrderByComparator<Role> orderByComparator)
      Specified by:
      getUserRoles in interface RoleLocalService
    • getUserRolesCount

      public int getUserRolesCount(long userId)
      Specified by:
      getUserRolesCount in interface RoleLocalService
    • getUserTeamRoles

      public List<Role> getUserTeamRoles(long userId, long groupId)
      Specified by:
      getUserTeamRoles in interface RoleLocalService
    • hasGroupRole

      public boolean hasGroupRole(long groupId, long roleId)
      Specified by:
      hasGroupRole in interface RoleLocalService
    • hasGroupRoles

      public boolean hasGroupRoles(long groupId)
      Specified by:
      hasGroupRoles in interface RoleLocalService
    • hasUserRole

      public boolean hasUserRole(long userId, long roleId)
      Specified by:
      hasUserRole in interface RoleLocalService
    • hasUserRole

      public boolean hasUserRole(long userId, long companyId, String name, boolean inherited) throws PortalException
      Returns true if the user is associated with the named regular role.
      Specified by:
      hasUserRole in interface RoleLocalService
      Parameters:
      userId - the primary key of the user
      companyId - the primary key of the company
      name - the name of the role
      inherited - 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 interface RoleLocalService
    • hasUserRoles

      public boolean hasUserRoles(long userId, long companyId, String[] names, boolean inherited) throws PortalException
      Returns true if the user has any one of the named regular roles.
      Specified by:
      hasUserRoles in interface RoleLocalService
      Parameters:
      userId - the primary key of the user
      companyId - the primary key of the company
      names - the names of the roles
      inherited - 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 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.

      Specified by:
      search in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      keywords - 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 return
      end - the upper bound of the range of roles to return (not inclusive)
      orderByComparator - the comparator to order the roles (optionally null)
      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 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.

      Specified by:
      search in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      keywords - 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 return
      end - the upper bound of the range of roles to return (not inclusive)
      orderByComparator - the comparator to order the roles (optionally null)
      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 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.

      Specified by:
      search in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      name - 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 return
      end - the upper bound of the range of the roles to return (not inclusive)
      orderByComparator - the comparator to order the roles (optionally null)
      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 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.

      Specified by:
      search in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      name - 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 return
      end - the upper bound of the range of the roles to return (not inclusive)
      orderByComparator - the comparator to order the roles (optionally null)
      Returns:
      the ordered range of the matching roles, ordered by orderByComparator
      See Also:
    • searchCount

      public int searchCount(long companyId, String keywords, Integer[] types)
      Returns the number of roles that match the keywords and types.
      Specified by:
      searchCount in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      keywords - the keywords (space separated), which may occur in the role's name or description (optionally null)
      types - the role types (optionally null)
      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 interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      keywords - 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
      Returns:
      the number of matching roles
    • searchCount

      public int searchCount(long companyId, String name, String description, Integer[] types)
      Returns the number of roles that match the name, description, and types.
      Specified by:
      searchCount in interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      name - the role's name (optionally null)
      description - the role's description (optionally null)
      types - the role types (optionally null)
      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 interface RoleLocalService
      Parameters:
      companyId - the primary key of the company
      name - 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
      Returns:
      the number of matching roles
    • setGroupRoles

      public void setGroupRoles(long groupId, long[] roleIds)
      Specified by:
      setGroupRoles in interface RoleLocalService
    • setUserRoles

      public void setUserRoles(long userId, long[] roleIds) throws PortalException
      Specified by:
      setUserRoles in interface RoleLocalService
      Throws:
      PortalException
      PortalException
    • unsetUserRoles

      public void unsetUserRoles(long userId, long[] roleIds) throws PortalException
      Removes the matching roles associated with the user. The user is reindexed after the roles are removed.
      Specified by:
      unsetUserRoles in interface RoleLocalService
      Parameters:
      userId - the primary key of the user
      roleIds - the primary keys of the roles
      Throws:
      PortalException
    • updateExternalReferenceCode

      public Role updateExternalReferenceCode(long roleId, String externalReferenceCode) throws PortalException
      Specified by:
      updateExternalReferenceCode in interface RoleLocalService
      Throws:
      PortalException
    • updateExternalReferenceCode

      public Role updateExternalReferenceCode(Role role, String externalReferenceCode) throws PortalException
      Specified by:
      updateExternalReferenceCode in interface RoleLocalService
      Throws:
      PortalException
    • updateRole

      public Role updateRole(long roleId, String name, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, String subtype, ServiceContext serviceContext) throws PortalException
      Updates the role with the primary key.
      Specified by:
      updateRole in interface RoleLocalService
      Parameters:
      roleId - the primary key of the role
      name - the role's new name
      titleMap - the new localized titles (optionally null) to replace those existing for the role
      descriptionMap - the new localized descriptions (optionally null) to replace those existing for the role
      subtype - the role's new subtype (optionally null)
      serviceContext - the service context to be applied (optionally null). Can set expando bridge attributes for the role.
      Returns:
      the role with the primary key
      Throws:
      PortalException
    • updateRole

      public Role updateRole(Role role)
      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 interface RoleLocalService
      Parameters:
      role - the role
      Returns:
      the role that was updated
    • validateName

      public void validateName(String name) throws PortalException
      Specified by:
      validateName in interface RoleLocalService
      Throws:
      PortalException
    • getBasePersistence

      public BasePersistence<?> getBasePersistence()
      Specified by:
      getBasePersistence in interface PersistedModelLocalService
    • getCTPersistence

      public CTPersistence<Role> getCTPersistence()
      Specified by:
      getCTPersistence in interface CTService<Role>
      Specified by:
      getCTPersistence in interface RoleLocalService
    • getModelClass

      public Class<Role> getModelClass()
      Specified by:
      getModelClass in interface CTService<Role>
      Specified by:
      getModelClass in interface RoleLocalService
    • updateWithUnsafeFunction

      public <R, E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<Role>,R,E> updateUnsafeFunction) throws E
      Specified by:
      updateWithUnsafeFunction in interface CTService<Role>
      Specified by:
      updateWithUnsafeFunction in interface RoleLocalService
      Throws:
      E extends Throwable
    • getWrappedService

      public RoleLocalService getWrappedService()
      Specified by:
      getWrappedService in interface ServiceWrapper<RoleLocalService>
    • setWrappedService

      public void setWrappedService(RoleLocalService roleLocalService)
      Specified by:
      setWrappedService in interface ServiceWrapper<RoleLocalService>