Liferay 7.0-ce-b4

com.liferay.portal.service
Class ResourcePermissionLocalServiceWrapper

java.lang.Object
  extended by com.liferay.portal.service.ResourcePermissionLocalServiceWrapper
All Implemented Interfaces:
BaseLocalService, PersistedModelLocalService, ResourcePermissionLocalService, ServiceWrapper<ResourcePermissionLocalService>

@ProviderType
public class ResourcePermissionLocalServiceWrapper
extends Object
implements ResourcePermissionLocalService, ServiceWrapper<ResourcePermissionLocalService>

Provides a wrapper for ResourcePermissionLocalService.

See Also:
ResourcePermissionLocalService

Constructor Summary
ResourcePermissionLocalServiceWrapper(ResourcePermissionLocalService resourcePermissionLocalService)
           
 
Method Summary
 void addResourcePermission(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.
 ResourcePermission addResourcePermission(ResourcePermission resourcePermission)
          Adds the resource permission to the database.
 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.
 ResourcePermission createResourcePermission(long resourcePermissionId)
          Creates a new resource permission with the primary key.
 PersistedModel deletePersistedModel(PersistedModel persistedModel)
           
 ResourcePermission deleteResourcePermission(long resourcePermissionId)
          Deletes the resource permission with the primary key from the database.
 ResourcePermission deleteResourcePermission(ResourcePermission resourcePermission)
          Deletes the resource permission from the database.
 void deleteResourcePermissions(long companyId, String name, int scope, long primKey)
          Deletes all resource permissions at the scope to resources of the type.
 void deleteResourcePermissions(long companyId, String name, int scope, String primKey)
          Deletes all resource permissions at the scope to resources of the type.
 DynamicQuery dynamicQuery()
           
<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.
 ResourcePermission fetchResourcePermission(long resourcePermissionId)
           
 ResourcePermission fetchResourcePermission(long companyId, String name, int scope, String primKey, long roleId)
           
 ActionableDynamicQuery getActionableDynamicQuery()
           
 Map<Long,Set<String>> getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, Collection<String> actionIds)
           
 Map<Long,Set<String>> getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, long[] roleIds, Collection<String> actionIds)
          Deprecated. As of 7.0.0, replaced by getAvailableResourcePermissionActionIds(long, String, int, String, Collection)
 List<String> 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.
 IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
           
 String getOSGiServiceIdentifier()
          Returns the OSGi service identifier.
 PersistedModel getPersistedModel(Serializable primaryKeyObj)
           
 ResourcePermission getResourcePermission(long resourcePermissionId)
          Returns the resource permission with the primary key.
 ResourcePermission 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.
 List<ResourcePermission> getResourcePermissions(int start, int end)
          Returns a range of all the resource permissions.
 List<ResourcePermission> getResourcePermissions(long companyId, String name, int scope, String primKey)
          Returns all the resource permissions at the scope of the type.
 int getResourcePermissionsCount()
          Returns the number of resource permissions.
 int getResourcePermissionsCount(long companyId, String name, int scope, String primKey)
          Returns the number of resource permissions at the scope of the type.
 List<ResourcePermission> getResourceResourcePermissions(long companyId, long groupId, String name, String primKey)
          Returns the resource permissions that apply to the resource.
 List<ResourcePermission> getRoleResourcePermissions(long roleId)
          Returns all the resource permissions for the role.
 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.
 List<Role> getRoles(long companyId, String name, int scope, String primKey, String actionId)
           
 List<ResourcePermission> getScopeResourcePermissions(int[] scopes)
          Returns all the resource permissions where scope = any ?.
 ResourcePermissionLocalService getWrappedService()
           
 boolean hasActionId(ResourcePermission resourcePermission, ResourceAction resourceAction)
          Returns true if the resource permission grants permission to perform the resource action.
 boolean hasResourcePermission(List<Resource> resources, long[] roleIds, String actionId)
          Returns true if the roles have permission at the scope to perform the action on the resources.
 boolean hasResourcePermission(long companyId, String name, int scope, String primKey, long[] roleIds, String actionId)
          Returns true if the roles have permission at the scope to perform the action on resources of the type.
 boolean hasResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId)
          Returns true if the role has permission at the scope to perform the action on resources of the type.
 boolean[] hasResourcePermissions(long companyId, String name, int scope, String primKey, long[] roleIds, String actionId)
          Deprecated. As of 7.0.0, replaced by #getRoles(long, String, int, String, String
 boolean hasScopeResourcePermission(long companyId, String name, int scope, long roleId, String actionId)
          Returns true if the role has permission at the scope to perform the action on the resource.
 void mergePermissions(long fromRoleId, long toRoleId)
          Reassigns all the resource permissions from the source role to the destination role, and deletes the source role.
 void reassignPermissions(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.
 void removeResourcePermission(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.
 void removeResourcePermissions(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.
 void setOwnerResourcePermissions(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.
 void setResourcePermissions(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.
 void setResourcePermissions(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.
 void setWrappedService(ResourcePermissionLocalService resourcePermissionLocalService)
           
 ResourcePermission updateResourcePermission(ResourcePermission resourcePermission)
          Updates the resource permission in the database or adds it if it does not yet exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourcePermissionLocalServiceWrapper

public ResourcePermissionLocalServiceWrapper(ResourcePermissionLocalService resourcePermissionLocalService)
Method Detail

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 primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
addResourcePermission in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope. This method only supports company, group, and group-template scope.
primKey - the primary key
roleId - the primary key of the role
actionId - the action ID
Throws:
PortalException

addResourcePermission

public ResourcePermission addResourcePermission(ResourcePermission resourcePermission)
Adds the resource permission to the database. Also notifies the appropriate model listeners.

Specified by:
addResourcePermission in interface ResourcePermissionLocalService
Parameters:
resourcePermission - the resource permission
Returns:
the resource permission that was added

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:
addResourcePermissions in interface ResourcePermissionLocalService
Parameters:
resourceName - the resource's name, which can be either a class name or a portlet ID
roleName - the role's name
scope - the scope
resourceActionBitwiseValue - the bitwise IDs of the actions

createResourcePermission

public ResourcePermission createResourcePermission(long resourcePermissionId)
Creates a new resource permission with the primary key. Does not add the resource permission to the database.

Specified by:
createResourcePermission in interface ResourcePermissionLocalService
Parameters:
resourcePermissionId - the primary key for the new resource permission
Returns:
the new resource permission

deletePersistedModel

public PersistedModel deletePersistedModel(PersistedModel persistedModel)
                                    throws PortalException
Specified by:
deletePersistedModel in interface PersistedModelLocalService
Specified by:
deletePersistedModel in interface ResourcePermissionLocalService
Throws:
PortalException

deleteResourcePermission

public ResourcePermission deleteResourcePermission(ResourcePermission resourcePermission)
Deletes the resource permission from the database. Also notifies the appropriate model listeners.

Specified by:
deleteResourcePermission in interface ResourcePermissionLocalService
Parameters:
resourcePermission - the resource permission
Returns:
the resource permission that was removed

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.

Specified by:
deleteResourcePermission in interface ResourcePermissionLocalService
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 found

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 the removeResourcePermission methods, 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 primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
deleteResourcePermissions in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - 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 the removeResourcePermission methods, 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 primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
deleteResourcePermissions in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
Throws:
PortalException

dynamicQuery

public DynamicQuery dynamicQuery()
Specified by:
dynamicQuery in interface ResourcePermissionLocalService

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 ResourcePermissionLocalService
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 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 and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from ResourcePermissionModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Specified by:
dynamicQuery in interface ResourcePermissionLocalService
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 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 and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from ResourcePermissionModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Specified by:
dynamicQuery in interface ResourcePermissionLocalService
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 ResourcePermissionLocalService
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 ResourcePermissionLocalService
Parameters:
dynamicQuery - the dynamic query
projection - the projection to apply to the query
Returns:
the number of rows matching the dynamic query

fetchResourcePermission

public ResourcePermission fetchResourcePermission(long companyId,
                                                  String name,
                                                  int scope,
                                                  String primKey,
                                                  long roleId)
Specified by:
fetchResourcePermission in interface ResourcePermissionLocalService

fetchResourcePermission

public ResourcePermission fetchResourcePermission(long resourcePermissionId)
Specified by:
fetchResourcePermission in interface ResourcePermissionLocalService

getActionableDynamicQuery

public ActionableDynamicQuery getActionableDynamicQuery()
Specified by:
getActionableDynamicQuery in interface ResourcePermissionLocalService

getAvailableResourcePermissionActionIds

public Map<Long,Set<String>> getAvailableResourcePermissionActionIds(long companyId,
                                                                     String name,
                                                                     int scope,
                                                                     String primKey,
                                                                     Collection<String> actionIds)
Specified by:
getAvailableResourcePermissionActionIds in interface ResourcePermissionLocalService

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:
getAvailableResourcePermissionActionIds in interface ResourcePermissionLocalService
Parameters:
companyId - he primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
roleId - the primary key of the role
actionIds - 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

getAvailableResourcePermissionActionIds

@Deprecated
public Map<Long,Set<String>> getAvailableResourcePermissionActionIds(long companyId,
                                                                                String name,
                                                                                int scope,
                                                                                String primKey,
                                                                                long[] roleIds,
                                                                                Collection<String> actionIds)
Deprecated. As of 7.0.0, replaced by getAvailableResourcePermissionActionIds(long, String, int, String, Collection)

Specified by:
getAvailableResourcePermissionActionIds in interface ResourcePermissionLocalService

getIndexableActionableDynamicQuery

public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
Specified by:
getIndexableActionableDynamicQuery in interface ResourcePermissionLocalService

getOSGiServiceIdentifier

public String getOSGiServiceIdentifier()
Returns the OSGi service identifier.

Specified by:
getOSGiServiceIdentifier in interface ResourcePermissionLocalService
Returns:
the OSGi service identifier

getPersistedModel

public PersistedModel getPersistedModel(Serializable primaryKeyObj)
                                 throws PortalException
Specified by:
getPersistedModel in interface PersistedModelLocalService
Specified by:
getPersistedModel in interface ResourcePermissionLocalService
Throws:
PortalException

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:
getResourcePermission in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
roleId - 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

getResourcePermission

public ResourcePermission getResourcePermission(long resourcePermissionId)
                                         throws PortalException
Returns the resource permission with the primary key.

Specified by:
getResourcePermission in interface ResourcePermissionLocalService
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 found

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:
getResourcePermissions in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
Returns:
the resource permissions at the scope of the type

getResourcePermissions

public List<ResourcePermission> getResourcePermissions(int start,
                                                       int end)
Returns a range of all the resource permissions.

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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from ResourcePermissionModelImpl. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.

Specified by:
getResourcePermissions in interface ResourcePermissionLocalService
Parameters:
start - the lower bound of the range of resource permissions
end - the upper bound of the range of resource permissions (not inclusive)
Returns:
the range of resource permissions

getResourcePermissionsCount

public int getResourcePermissionsCount()
Returns the number of resource permissions.

Specified by:
getResourcePermissionsCount in interface ResourcePermissionLocalService
Returns:
the number of resource permissions

getResourcePermissionsCount

public int getResourcePermissionsCount(long companyId,
                                       String name,
                                       int scope,
                                       String primKey)
Returns the number of resource permissions at the scope of the type.

Specified by:
getResourcePermissionsCount in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - 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:
getResourceResourcePermissions in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the resource's company
groupId - the primary key of the resource's group
name - the resource's name, which can be either a class name or a portlet ID
primKey - the primary key of the resource
Returns:
the resource permissions associated with the resource

getRoleResourcePermissions

public List<ResourcePermission> getRoleResourcePermissions(long roleId)
Returns all the resource permissions for the role.

Specified by:
getRoleResourcePermissions in interface ResourcePermissionLocalService
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 - 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:
getRoleResourcePermissions in interface ResourcePermissionLocalService
Parameters:
roleId - the primary key of the role
scopes - the scopes
start - the lower bound of the range of results
end - 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:
getRoles in interface ResourcePermissionLocalService
Throws:
PortalException

getScopeResourcePermissions

public List<ResourcePermission> getScopeResourcePermissions(int[] scopes)
Returns all the resource permissions where scope = any ?.

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:
getScopeResourcePermissions in interface ResourcePermissionLocalService
Parameters:
scopes - the scopes
Returns:
the resource permissions where scope = any ?

hasActionId

public boolean hasActionId(ResourcePermission resourcePermission,
                           ResourceAction resourceAction)
Returns true if 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:
hasActionId in interface ResourcePermissionLocalService
Parameters:
resourcePermission - the resource permission
resourceAction - the resource action
Returns:
true if the resource permission grants permission to perform the resource action

hasResourcePermission

public boolean hasResourcePermission(long companyId,
                                     String name,
                                     int scope,
                                     String primKey,
                                     long roleId,
                                     String actionId)
                              throws PortalException
Returns true if the role has permission at the scope to perform the action on resources of the type.

Depending on the scope, the value of primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
hasResourcePermission in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
roleId - the primary key of the role
actionId - the action ID
Returns:
true if the role has permission to perform the action on the resource; false otherwise
Throws:
PortalException

hasResourcePermission

public boolean hasResourcePermission(long companyId,
                                     String name,
                                     int scope,
                                     String primKey,
                                     long[] roleIds,
                                     String actionId)
                              throws PortalException
Returns true if the roles have permission at the scope to perform the action on resources of the type.

Depending on the scope, the value of primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
hasResourcePermission in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
roleIds - the primary keys of the roles
actionId - the action ID
Returns:
true if any one of the roles has permission to perform the action on the resource; false otherwise
Throws:
PortalException

hasResourcePermission

public boolean hasResourcePermission(List<Resource> resources,
                                     long[] roleIds,
                                     String actionId)
                              throws PortalException
Returns true if the roles have permission at the scope to perform the action on the resources.

Depending on the scope, the value of primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
hasResourcePermission in interface ResourcePermissionLocalService
Parameters:
resources - the resources
roleIds - the primary keys of the roles
actionId - the action ID
Returns:
true if any one of the roles has permission to perform the action on any one of the resources; false otherwise
Throws:
PortalException

hasResourcePermissions

@Deprecated
public boolean[] hasResourcePermissions(long companyId,
                                                   String name,
                                                   int scope,
                                                   String primKey,
                                                   long[] roleIds,
                                                   String actionId)
                                 throws PortalException
Deprecated. As of 7.0.0, replaced by #getRoles(long, String, int, String, String

Specified by:
hasResourcePermissions in interface ResourcePermissionLocalService
Throws:
PortalException

hasScopeResourcePermission

public boolean hasScopeResourcePermission(long companyId,
                                          String name,
                                          int scope,
                                          long roleId,
                                          String actionId)
                                   throws PortalException
Returns true if the role has permission at the scope to perform the action on the resource.

Depending on the scope, the value of primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
hasScopeResourcePermission in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
roleId - the primary key of the role
actionId - the action ID
Returns:
true if the role has permission to perform the action on the resource; false otherwise
Throws:
PortalException

mergePermissions

public void mergePermissions(long fromRoleId,
                             long toRoleId)
                      throws PortalException
Reassigns all the resource permissions from the source role to the destination role, and deletes the source role.

Specified by:
mergePermissions in interface ResourcePermissionLocalService
Parameters:
fromRoleId - the primary key of the source role
toRoleId - the primary key of the destination role
Throws:
PortalException

reassignPermissions

public void reassignPermissions(long resourcePermissionId,
                                long toRoleId)
                         throws PortalException
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:
reassignPermissions in interface ResourcePermissionLocalService
Parameters:
resourcePermissionId - the primary key of the resource permission
toRoleId - 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 primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
removeResourcePermission in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
roleId - the primary key of the role
actionId - 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:
removeResourcePermissions in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
roleId - the primary key of the role
actionId - 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 primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
setOwnerResourcePermissions in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
roleId - the primary key of the role
ownerId - 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 primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
setResourcePermissions in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
roleId - the primary key of the role
actionIds - 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 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 primKey will have different meanings. For more information, see ResourcePermissionImpl.

Specified by:
setResourcePermissions in interface ResourcePermissionLocalService
Parameters:
companyId - the primary key of the company
name - the resource's name, which can be either a class name or a portlet ID
scope - the scope
primKey - the primary key
roleIdsToActionIds - a map of role IDs to action IDs of the actions
Throws:
PortalException

updateResourcePermission

public ResourcePermission updateResourcePermission(ResourcePermission resourcePermission)
Updates the resource permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Specified by:
updateResourcePermission in interface ResourcePermissionLocalService
Parameters:
resourcePermission - the resource permission
Returns:
the resource permission that was updated

getWrappedService

public ResourcePermissionLocalService getWrappedService()
Specified by:
getWrappedService in interface ServiceWrapper<ResourcePermissionLocalService>

setWrappedService

public void setWrappedService(ResourcePermissionLocalService resourcePermissionLocalService)
Specified by:
setWrappedService in interface ServiceWrapper<ResourcePermissionLocalService>

Liferay 7.0-ce-b4