Class ResourcePermissionLocalServiceWrapper
- All Implemented Interfaces:
BaseLocalService,CTService<ResourcePermission>,PersistedModelLocalService,ResourcePermissionLocalService,ServiceWrapper<ResourcePermissionLocalService>
ResourcePermissionLocalService.- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Constructor Summary
ConstructorsConstructorDescriptionResourcePermissionLocalServiceWrapper(ResourcePermissionLocalService resourcePermissionLocalService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModelResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, ModelPermissions modelPermissions) voidaddModelResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, String[] groupPermissions, String[] guestPermissions) Adds resources for the model with the name and primary key string, always creating a resource at the individual scope and only creating resources at the group, group template, and company scope if such resources don't already exist.voidaddModelResourcePermissions(AuditedModel auditedModel, ServiceContext serviceContext) voidaddResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) Grants the role permission at the scope to perform the action on resources of the type.addResourcePermission(ResourcePermission resourcePermission) Adds the resource permission to the database.voidaddResourcePermissions(long companyId, long groupId, long userId, String name, String[] primKeys, boolean portletActions, ServiceContext serviceContext) voidaddResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, boolean portletActions, ServiceContext serviceContext) Adds resources for the entity with the name and primary key string, always creating a resource at the individual scope and only creating resources at the group, group template, and company scope if such resources don't already exist.voidaddResourcePermissions(String resourceName, String roleName, int scope, long resourceActionBitwiseValue) Grants the role permissions at the scope to perform the actions on all resources of the type.voidcopyModelResourcePermissions(long companyId, String name, long sourcePrimKey, long targetPrimKey) createPersistedModel(Serializable primaryKeyObj) createResourcePermission(long resourcePermissionId) Creates a new resource permission with the primary key.deletePersistedModel(PersistedModel persistedModel) deleteResourcePermission(long resourcePermissionId) Deletes the resource permission with the primary key from the database.deleteResourcePermission(ResourcePermission resourcePermission) Deletes the resource permission from the database.voiddeleteResourcePermissions(long companyId, String name, int scope) voiddeleteResourcePermissions(long companyId, String name, int scope, long primKey) Deletes all resource permissions at the scope to resources of the type.voiddeleteResourcePermissions(long companyId, String name, int scope, String primKey) Deletes all resource permissions at the scope to resources of the type.void<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.fetchResourcePermission(long resourcePermissionId) fetchResourcePermission(long companyId, String name, int scope, String primKey, long roleId) getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, long roleId, Collection<String> actionIds) Returns the intersection of action IDs the role has permission at the scope to perform on resources of the type.getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, Collection<String> actionIds) getIndividualPortletResourcePermissions(long companyId) Returns the OSGi service identifier.getPersistedModel(Serializable primaryKeyObj) getResourcePermission(long resourcePermissionId) Returns the resource permission with the primary key.getResourcePermission(long companyId, String name, int scope, String primKey, long roleId) Returns the resource permission for the role at the scope to perform the actions on resources of the type.getResourcePermissions(int start, int end) Returns a range of all the resource permissions.getResourcePermissions(long companyId, String name, int scope, long roleId, boolean viewActionId) getResourcePermissions(long companyId, String name, int scope, String primKey) Returns all the resource permissions at the scope of the type.getResourcePermissions(String name) intReturns the number of resource permissions.intgetResourcePermissionsCount(long companyId, String name, int scope, String primKey) Returns the number of resource permissions at the scope of the type.getResourceResourcePermissions(long companyId, long groupId, String name, String primKey) Returns the resource permissions that apply to the resource.getRoleResourcePermissions(long roleId) Returns all the resource permissions for the role.getRoleResourcePermissions(long roleId, int[] scopes, int start, int end) Returns a range of all the resource permissions for the role at the scopes.getScopeResourcePermissions(int[] scopes) Returns all the resource permissions where scope = any ?.booleanhasActionId(ResourcePermission resourcePermission, ResourceAction resourceAction) Returnstrueif the resource permission grants permission to perform the resource action.booleanhasResourcePermission(long companyId, String name, int scope, String primKey, long[] roleIds, String actionId) Returnstrueif the roles have permission at the scope to perform the action on resources of the type.booleanhasResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) Returnstrueif the role has permission at the scope to perform the action on resources of the type.booleanhasResourcePermission(List<Resource> resources, long[] roleIds, String actionId) Returnstrueif the roles have permission at the scope to perform the action on the resources.booleanhasScopeResourcePermission(long companyId, String name, int scope, long roleId, String actionId) Returnstrueif the role has permission at the scope to perform the action on the resource.voidinitDefaultModelResourcePermissions(long companyId, Collection<String> modelResources) voidinitPortletDefaultPermissions(Portlet portlet) voidmergePermissions(long fromRoleId, long toRoleId) Reassigns all the resource permissions from the source role to the destination role, and deletes the source role.voidreassignPermissions(long resourcePermissionId, long toRoleId) Grants the role default permissions to all the resources of the type and at the scope stored in the resource permission, deletes the resource permission, and deletes the resource permission's role if it has no permissions remaining.voidremoveResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) Revokes permission at the scope from the role to perform the action on resources of the type.voidremoveResourcePermissions(long companyId, String name, int scope, long roleId, String actionId) Revokes all permissions at the scope from the role to perform the action on resources of the type.voidsetOwnerResourcePermissions(long companyId, String name, int scope, String primKey, long roleId, long ownerId, String[] actionIds) Updates the role's permissions at the scope, setting the actions that can be performed on resources of the type, also setting the owner of any newly created resource permissions.voidsetResourcePermissions(long companyId, String name, int scope, String primKey, long roleId, String[] actionIds) Updates the role's permissions at the scope, setting the actions that can be performed on resources of the type.voidsetResourcePermissions(long companyId, String name, int scope, String primKey, Map<Long, String[]> roleIdsToActionIds) Updates the role's permissions at the scope, setting the actions that can be performed on resources of the type.voidsetWrappedService(ResourcePermissionLocalService resourcePermissionLocalService) voidupdateModelResourcePermissions(AuditedModel auditedModel, ServiceContext serviceContext) Updates the resources for the model, replacing their group and guest permissions with new ones from the service context.updateResourcePermission(ResourcePermission resourcePermission) Updates the resource permission in the database or adds it if it does not yet exist.voidupdateResourcePermissions(long companyId, long groupId, String name, long primKey, String[] groupPermissions, String[] guestPermissions) Updates resources matching the group, name, and primary key at the individual scope, setting new group and guest permissions.voidupdateResourcePermissions(long companyId, long groupId, String name, String primKey, ModelPermissions modelPermissions) voidupdateResourcePermissions(long companyId, long groupId, String name, String primKey, String[] groupPermissions, String[] guestPermissions) voidupdateResourcePermissions(long companyId, String name, int scope, String primKey, String newPrimKey) <R,E extends Throwable>
RupdateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<ResourcePermission>, R, E> updateUnsafeFunction) 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
-
ResourcePermissionLocalServiceWrapper
public ResourcePermissionLocalServiceWrapper() -
ResourcePermissionLocalServiceWrapper
public ResourcePermissionLocalServiceWrapper(ResourcePermissionLocalService resourcePermissionLocalService)
-
-
Method Details
-
addModelResourcePermissions
public void addModelResourcePermissions(AuditedModel auditedModel, ServiceContext serviceContext) throws PortalException - Specified by:
addModelResourcePermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
addModelResourcePermissions
public void addModelResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, ModelPermissions modelPermissions) throws PortalException - Specified by:
addModelResourcePermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
addModelResourcePermissions
public void addModelResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, String[] groupPermissions, String[] guestPermissions) throws PortalException Adds resources for the model with the name and primary key string, always creating a resource at the individual scope and only creating resources at the group, group template, and company scope if such resources don't already exist.- Specified by:
addModelResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the portal instancegroupId- the primary key of the groupuserId- the primary key of the user adding the resourcesname- a name for the resource, typically the model's class nameprimKey- the primary key string of the model instance, optionally an empty string if no instance existsgroupPermissions- the group permissions to be appliedguestPermissions- the guest permissions to be applied- Throws:
PortalException
-
addResourcePermission
public void addResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) throws PortalException Grants the role permission at the scope to perform the action on resources of the type. Existing actions are retained.This method cannot be used to grant individual scope permissions, but is only intended for adding permissions at the company, group, and group-template scopes. For example, this method could be used to grant a company scope permission to edit message board posts.
If a company scope permission is granted to resources that the role already had group scope permissions to, the group scope permissions are deleted. Likewise, if a group scope permission is granted to resources that the role already had company scope permissions to, the company scope permissions are deleted. Be aware that this latter behavior can result in an overall reduction in permissions for the role.
Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
addResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scope. This method only supports company, group, and group-template scope.primKey- the primary keyroleId- the primary key of the roleactionId- the action ID- Throws:
PortalException
-
addResourcePermission
Adds the resource permission to the database. Also notifies the appropriate model listeners.Important: Inspect ResourcePermissionLocalServiceImpl 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:
addResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
resourcePermission- the resource permission- Returns:
- the resource permission that was added
-
addResourcePermissions
public void addResourcePermissions(long companyId, long groupId, long userId, String name, String primKey, boolean portletActions, ServiceContext serviceContext) throws PortalException Adds resources for the entity with the name and primary key string, always creating a resource at the individual scope and only creating resources at the group, group template, and company scope if such resources don't already exist.- Specified by:
addResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the portal instancegroupId- the primary key of the groupuserId- the primary key of the user adding the resourcesname- a name for the resource, which should be a portlet ID if the resource is a portlet or the resource's class name otherwiseprimKey- the primary key string of the resource instance, optionally an empty string if no instance existsportletActions- whether to associate portlet actions with the resource- Throws:
PortalException
-
addResourcePermissions
public void addResourcePermissions(long companyId, long groupId, long userId, String name, String[] primKeys, boolean portletActions, ServiceContext serviceContext) throws PortalException - Specified by:
addResourcePermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
addResourcePermissions
public void addResourcePermissions(String resourceName, String roleName, int scope, long resourceActionBitwiseValue) Grants the role permissions at the scope to perform the actions on all resources of the type. Existing actions are retained.This method should only be used to add default permissions to existing resources en masse during upgrades or while verifying permissions. For example, this method could be used to grant site members individual scope permissions to view all blog posts.
- Specified by:
addResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
resourceName- the resource's name, which can be either a class name or a portlet IDroleName- the role's namescope- the scoperesourceActionBitwiseValue- the bitwise IDs of the actions
-
copyModelResourcePermissions
public void copyModelResourcePermissions(long companyId, String name, long sourcePrimKey, long targetPrimKey) throws PortalException - Specified by:
copyModelResourcePermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
createPersistedModel
- Specified by:
createPersistedModelin interfacePersistedModelLocalService- Specified by:
createPersistedModelin interfaceResourcePermissionLocalService- Throws:
PortalExceptionPortalException
-
createResourcePermission
Creates a new resource permission with the primary key. Does not add the resource permission to the database.- Specified by:
createResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
resourcePermissionId- the primary key for the new resource permission- Returns:
- the new resource permission
-
deletePersistedModel
- Specified by:
deletePersistedModelin interfacePersistedModelLocalService- Specified by:
deletePersistedModelin interfaceResourcePermissionLocalService- Throws:
PortalExceptionPortalException
-
deleteResourcePermission
public ResourcePermission deleteResourcePermission(long resourcePermissionId) throws PortalException Deletes the resource permission with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect ResourcePermissionLocalServiceImpl 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:
deleteResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
resourcePermissionId- the primary key of the resource permission- Returns:
- the resource permission that was removed
- Throws:
PortalException- if a resource permission with the primary key could not be foundPortalException
-
deleteResourcePermission
Deletes the resource permission from the database. Also notifies the appropriate model listeners.Important: Inspect ResourcePermissionLocalServiceImpl 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:
deleteResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
resourcePermission- the resource permission- Returns:
- the resource permission that was removed
-
deleteResourcePermissions
public void deleteResourcePermissions(long companyId, String name, int scope) throws PortalException - Specified by:
deleteResourcePermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
deleteResourcePermissions
public void deleteResourcePermissions(long companyId, String name, int scope, long primKey) throws PortalException Deletes all resource permissions at the scope to resources of the type. This method should not be confused with any of theremoveResourcePermissionmethods, as its purpose is very different. This method should only be used for deleting resource permissions that refer to a resource when that resource is deleted. For example this method could be used to delete all individual scope permissions to a blog post when it is deleted.Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
deleteResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary key- Throws:
PortalException
-
deleteResourcePermissions
public void deleteResourcePermissions(long companyId, String name, int scope, String primKey) throws PortalException Deletes all resource permissions at the scope to resources of the type. This method should not be confused with any of theremoveResourcePermissionmethods, as its purpose is very different. This method should only be used for deleting resource permissions that refer to a resource when that resource is deleted. For example this method could be used to delete all individual scope permissions to a blog post when it is deleted.Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
deleteResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary key- Throws:
PortalException
-
deleteResourcePermissions
- Specified by:
deleteResourcePermissionsin interfaceResourcePermissionLocalService
-
dslQuery
public <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQueryin interfacePersistedModelLocalService- Specified by:
dslQueryin interfaceResourcePermissionLocalService
-
dslQueryCount
public int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQueryCountin interfacePersistedModelLocalService- Specified by:
dslQueryCountin interfaceResourcePermissionLocalService
-
dynamicQuery
- Specified by:
dynamicQueryin interfaceResourcePermissionLocalService
-
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Specified by:
dynamicQueryin interfaceResourcePermissionLocalService- 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.ResourcePermissionModelImpl.- Specified by:
dynamicQueryin interfaceResourcePermissionLocalService- 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.ResourcePermissionModelImpl.- Specified by:
dynamicQueryin interfaceResourcePermissionLocalService- 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 interfaceResourcePermissionLocalService- 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 interfaceResourcePermissionLocalService- Parameters:
dynamicQuery- the dynamic queryprojection- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchResourcePermission
- Specified by:
fetchResourcePermissionin interfaceResourcePermissionLocalService
-
fetchResourcePermission
public ResourcePermission fetchResourcePermission(long companyId, String name, int scope, String primKey, long roleId) - Specified by:
fetchResourcePermissionin interfaceResourcePermissionLocalService
-
getActionableDynamicQuery
- Specified by:
getActionableDynamicQueryin interfaceResourcePermissionLocalService
-
getAvailableResourcePermissionActionIds
public Map<Long,Set<String>> getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, Collection<String> actionIds) - Specified by:
getAvailableResourcePermissionActionIdsin interfaceResourcePermissionLocalService
-
getAvailableResourcePermissionActionIds
public List<String> getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, long roleId, Collection<String> actionIds) throws PortalException Returns the intersection of action IDs the role has permission at the scope to perform on resources of the type.- Specified by:
getAvailableResourcePermissionActionIdsin interfaceResourcePermissionLocalService- Parameters:
companyId- he primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary keyroleId- the primary key of the roleactionIds- the action IDs- Returns:
- the intersection of action IDs the role has permission at the scope to perform on resources of the type
- Throws:
PortalException
-
getIndexableActionableDynamicQuery
- Specified by:
getIndexableActionableDynamicQueryin interfaceResourcePermissionLocalService
-
getIndividualPortletResourcePermissions
- Specified by:
getIndividualPortletResourcePermissionsin interfaceResourcePermissionLocalService
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Specified by:
getOSGiServiceIdentifierin interfaceResourcePermissionLocalService- Returns:
- the OSGi service identifier
-
getPersistedModel
- Specified by:
getPersistedModelin interfacePersistedModelLocalService- Specified by:
getPersistedModelin interfaceResourcePermissionLocalService- Throws:
PortalExceptionPortalException
-
getResourcePermission
Returns the resource permission with the primary key.- Specified by:
getResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
resourcePermissionId- the primary key of the resource permission- Returns:
- the resource permission
- Throws:
PortalException- if a resource permission with the primary key could not be foundPortalException
-
getResourcePermission
public ResourcePermission getResourcePermission(long companyId, String name, int scope, String primKey, long roleId) throws PortalException Returns the resource permission for the role at the scope to perform the actions on resources of the type.- Specified by:
getResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary keyroleId- the primary key of the role- Returns:
- the resource permission for the role at the scope to perform the actions on resources of the type
- Throws:
PortalException
-
getResourcePermissions
Returns a range of all the resource permissions.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.ResourcePermissionModelImpl.- Specified by:
getResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
start- the lower bound of the range of resource permissionsend- the upper bound of the range of resource permissions (not inclusive)- Returns:
- the range of resource permissions
-
getResourcePermissions
public List<ResourcePermission> getResourcePermissions(long companyId, String name, int scope, long roleId, boolean viewActionId) - Specified by:
getResourcePermissionsin interfaceResourcePermissionLocalService
-
getResourcePermissions
public List<ResourcePermission> getResourcePermissions(long companyId, String name, int scope, String primKey) Returns all the resource permissions at the scope of the type.- Specified by:
getResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary key- Returns:
- the resource permissions at the scope of the type
-
getResourcePermissions
- Specified by:
getResourcePermissionsin interfaceResourcePermissionLocalService
-
getResourcePermissionsCount
public int getResourcePermissionsCount()Returns the number of resource permissions.- Specified by:
getResourcePermissionsCountin interfaceResourcePermissionLocalService- Returns:
- the number of resource permissions
-
getResourcePermissionsCount
Returns the number of resource permissions at the scope of the type.- Specified by:
getResourcePermissionsCountin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary key- Returns:
- the number of resource permissions at the scope of the type
-
getResourceResourcePermissions
public List<ResourcePermission> getResourceResourcePermissions(long companyId, long groupId, String name, String primKey) Returns the resource permissions that apply to the resource.- Specified by:
getResourceResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the resource's companygroupId- the primary key of the resource's groupname- the resource's name, which can be either a class name or a portlet IDprimKey- the primary key of the resource- Returns:
- the resource permissions associated with the resource
-
getRoleResourcePermissions
Returns all the resource permissions for the role.- Specified by:
getRoleResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
roleId- the primary key of the role- Returns:
- the resource permissions for the role
-
getRoleResourcePermissions
public List<ResourcePermission> getRoleResourcePermissions(long roleId, int[] scopes, int start, int end) Returns a range of all the resource permissions for the role at the scopes.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:
getRoleResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
roleId- the primary key of the rolescopes- the scopesstart- the lower bound of the range of resultsend- the upper bound of the range of results (not inclusive)- Returns:
- the range of resource permissions for the role at the scopes
-
getRoles
public List<Role> getRoles(long companyId, String name, int scope, String primKey, String actionId) throws PortalException - Specified by:
getRolesin interfaceResourcePermissionLocalService- Throws:
PortalException
-
getScopeResourcePermissions
Returns all the resource permissions where scope = any ?.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:
getScopeResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
scopes- the scopes- Returns:
- the resource permissions where scope = any ?
-
hasActionId
Returnstrueif the resource permission grants permission to perform the resource action. Note that this method does not ensure that the resource permission refers to the same type of resource as the resource action.- Specified by:
hasActionIdin interfaceResourcePermissionLocalService- Parameters:
resourcePermission- the resource permissionresourceAction- the resource action- Returns:
trueif the resource permission grants permission to perform the resource action
-
hasResourcePermission
public boolean hasResourcePermission(List<Resource> resources, long[] roleIds, String actionId) throws PortalException Returnstrueif the roles have permission at the scope to perform the action on the resources.Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
hasResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
resources- the resourcesroleIds- the primary keys of the rolesactionId- the action ID- Returns:
trueif any one of the roles has permission to perform the action on any one of the resources;falseotherwise- Throws:
PortalException
-
hasResourcePermission
public boolean hasResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) throws PortalException Returnstrueif the role has permission at the scope to perform the action on resources of the type.Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
hasResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary keyroleId- the primary key of the roleactionId- the action ID- Returns:
trueif the role has permission to perform the action on the resource;falseotherwise- Throws:
PortalException
-
hasResourcePermission
public boolean hasResourcePermission(long companyId, String name, int scope, String primKey, long[] roleIds, String actionId) throws PortalException Returnstrueif the roles have permission at the scope to perform the action on resources of the type.Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
hasResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary keyroleIds- the primary keys of the rolesactionId- the action ID- Returns:
trueif any one of the roles has permission to perform the action on the resource;falseotherwise- Throws:
PortalException
-
hasScopeResourcePermission
public boolean hasScopeResourcePermission(long companyId, String name, int scope, long roleId, String actionId) throws PortalException Returnstrueif the role has permission at the scope to perform the action on the resource.Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
hasScopeResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scoperoleId- the primary key of the roleactionId- the action ID- Returns:
trueif the role has permission to perform the action on the resource;falseotherwise- Throws:
PortalException
-
initDefaultModelResourcePermissions
public void initDefaultModelResourcePermissions(long companyId, Collection<String> modelResources) throws PortalException - Specified by:
initDefaultModelResourcePermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
initPortletDefaultPermissions
- Specified by:
initPortletDefaultPermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
mergePermissions
Reassigns all the resource permissions from the source role to the destination role, and deletes the source role.- Specified by:
mergePermissionsin interfaceResourcePermissionLocalService- Parameters:
fromRoleId- the primary key of the source roletoRoleId- the primary key of the destination role- Throws:
PortalException
-
reassignPermissions
Grants the role default permissions to all the resources of the type and at the scope stored in the resource permission, deletes the resource permission, and deletes the resource permission's role if it has no permissions remaining.- Specified by:
reassignPermissionsin interfaceResourcePermissionLocalService- Parameters:
resourcePermissionId- the primary key of the resource permissiontoRoleId- the primary key of the role- Throws:
PortalException
-
removeResourcePermission
public void removeResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId) throws PortalException Revokes permission at the scope from the role to perform the action on resources of the type. For example, this method could be used to revoke a group scope permission to edit blog posts.Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
removeResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary keyroleId- the primary key of the roleactionId- the action ID- Throws:
PortalException
-
removeResourcePermissions
public void removeResourcePermissions(long companyId, String name, int scope, long roleId, String actionId) throws PortalException Revokes all permissions at the scope from the role to perform the action on resources of the type. For example, this method could be used to revoke all individual scope permissions to edit blog posts from site members.- Specified by:
removeResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scoperoleId- the primary key of the roleactionId- the action ID- Throws:
PortalException
-
setOwnerResourcePermissions
public void setOwnerResourcePermissions(long companyId, String name, int scope, String primKey, long roleId, long ownerId, String[] actionIds) throws PortalException Updates the role's permissions at the scope, setting the actions that can be performed on resources of the type, also setting the owner of any newly created resource permissions. Existing actions are replaced.This method can be used to set permissions at any scope, but it is generally only used at the individual scope. For example, it could be used to set the guest permissions on a blog post.
Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
setOwnerResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary keyroleId- the primary key of the roleownerId- the primary key of the owner (generally the user that created the resource)actionIds- the action IDs of the actions- Throws:
PortalException
-
setResourcePermissions
public void setResourcePermissions(long companyId, String name, int scope, String primKey, long roleId, String[] actionIds) throws PortalException Updates the role's permissions at the scope, setting the actions that can be performed on resources of the type. Existing actions are replaced.This method can be used to set permissions at any scope, but it is generally only used at the individual scope. For example, it could be used to set the guest permissions on a blog post.
Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
setResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary keyroleId- the primary key of the roleactionIds- the action IDs of the actions- Throws:
PortalException
-
setResourcePermissions
public void setResourcePermissions(long companyId, String name, int scope, String primKey, Map<Long, String[]> roleIdsToActionIds) throws PortalExceptionUpdates the role's permissions at the scope, setting the actions that can be performed on resources of the type. Existing actions are replaced.This method can be used to set permissions at any scope, but it is generally only used at the individual scope. For example, it could be used to set the guest permissions on a blog post.
Depending on the scope, the value of
primKeywill have different meanings. For more information, seeResourcePermissionImpl.- Specified by:
setResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the companyname- the resource's name, which can be either a class name or a portlet IDscope- the scopeprimKey- the primary keyroleIdsToActionIds- a map of role IDs to action IDs of the actions- Throws:
PortalException
-
updateModelResourcePermissions
public void updateModelResourcePermissions(AuditedModel auditedModel, ServiceContext serviceContext) throws PortalException Updates the resources for the model, replacing their group and guest permissions with new ones from the service context.- Specified by:
updateModelResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
auditedModel- the model associated with the resourcesserviceContext- the service context to be applied. Can set group and guest permissions.- Throws:
PortalException
-
updateResourcePermission
Updates the resource permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect ResourcePermissionLocalServiceImpl 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:
updateResourcePermissionin interfaceResourcePermissionLocalService- Parameters:
resourcePermission- the resource permission- Returns:
- the resource permission that was updated
-
updateResourcePermissions
public void updateResourcePermissions(long companyId, long groupId, String name, long primKey, String[] groupPermissions, String[] guestPermissions) throws PortalException Updates resources matching the group, name, and primary key at the individual scope, setting new group and guest permissions.- Specified by:
updateResourcePermissionsin interfaceResourcePermissionLocalService- Parameters:
companyId- the primary key of the portal instancegroupId- the primary key of the groupname- the resource's name, which should be a portlet ID if the resource is a portlet or the resource's class name otherwiseprimKey- the primary key of the resource instancegroupPermissions- the group permissions to be appliedguestPermissions- the guest permissions to be applied- Throws:
PortalException
-
updateResourcePermissions
public void updateResourcePermissions(long companyId, long groupId, String name, String primKey, ModelPermissions modelPermissions) throws PortalException - Specified by:
updateResourcePermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
updateResourcePermissions
public void updateResourcePermissions(long companyId, long groupId, String name, String primKey, String[] groupPermissions, String[] guestPermissions) throws PortalException - Specified by:
updateResourcePermissionsin interfaceResourcePermissionLocalService- Throws:
PortalException
-
updateResourcePermissions
public void updateResourcePermissions(long companyId, String name, int scope, String primKey, String newPrimKey) - Specified by:
updateResourcePermissionsin interfaceResourcePermissionLocalService
-
getBasePersistence
- Specified by:
getBasePersistencein interfacePersistedModelLocalService
-
getCTPersistence
- Specified by:
getCTPersistencein interfaceCTService<ResourcePermission>- Specified by:
getCTPersistencein interfaceResourcePermissionLocalService
-
getModelClass
- Specified by:
getModelClassin interfaceCTService<ResourcePermission>- Specified by:
getModelClassin interfaceResourcePermissionLocalService
-
updateWithUnsafeFunction
public <R,E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<ResourcePermission>, R, throws EE> updateUnsafeFunction) - Specified by:
updateWithUnsafeFunctionin interfaceCTService<ResourcePermission>- Specified by:
updateWithUnsafeFunctionin interfaceResourcePermissionLocalService- Throws:
E extends Throwable
-
getWrappedService
- Specified by:
getWrappedServicein interfaceServiceWrapper<ResourcePermissionLocalService>
-
setWrappedService
- Specified by:
setWrappedServicein interfaceServiceWrapper<ResourcePermissionLocalService>
-