Liferay 6.0-ee

com.liferay.portal.service
Class ResourcePermissionLocalServiceUtil

java.lang.Object
  extended by com.liferay.portal.service.ResourcePermissionLocalServiceUtil

public class ResourcePermissionLocalServiceUtil
extends Object

The utility for the resource permission local service. This utility wraps ResourcePermissionLocalServiceImpl and is the primary access point for service operations in application layer code running on the local server.

Never modify this class directly. Add custom service methods to ResourcePermissionLocalServiceImpl and rerun ServiceBuilder to regenerate this class.

This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.

See Also:
ResourcePermissionLocalService, ResourcePermissionLocalServiceBaseImpl, ResourcePermissionLocalServiceImpl
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time it is generated.

Constructor Summary
ResourcePermissionLocalServiceUtil()
           
 
Method Summary
static void addResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId)
           
static ResourcePermission addResourcePermission(ResourcePermission resourcePermission)
          Adds the resource permission to the database.
static ResourcePermission createResourcePermission(long resourcePermissionId)
          Creates a new resource permission with the primary key.
static void deleteResourcePermission(long resourcePermissionId)
          Deletes the resource permission with the primary key from the database.
static void deleteResourcePermission(ResourcePermission resourcePermission)
          Deletes the resource permission from the database.
static List dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
static List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
static List dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
          Performs a dynamic query on the database and returns an ordered range of the matching rows.
static long dynamicQueryCount(DynamicQuery dynamicQuery)
          Counts the number of rows that match the dynamic query.
static List<String> getAvailableResourcePermissionActionIds(long companyId, String name, int scope, String primKey, long roleId, List<String> actionIds)
           
static ResourcePermission getResourcePermission(long resourcePermissionId)
          Gets the resource permission with the primary key.
static List<ResourcePermission> getResourcePermissions(int start, int end)
          Gets a range of all the resource permissions.
static List<ResourcePermission> getResourcePermissions(long companyId, String name, int scope, String primKey)
           
static int getResourcePermissionsCount()
          Gets the number of resource permissions.
static int getResourcePermissionsCount(long companyId, String name, int scope, String primKey)
           
static List<ResourcePermission> getRoleResourcePermissions(long roleId)
           
static List<ResourcePermission> getRoleResourcePermissions(long roleId, int[] scopes, int start, int end)
           
static ResourcePermissionLocalService getService()
           
static boolean hasActionId(ResourcePermission resourcePermission, ResourceAction resourceAction)
           
static boolean hasResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId)
           
static boolean hasScopeResourcePermission(long companyId, String name, int scope, long roleId, String actionId)
           
static void mergePermissions(long fromRoleId, long toRoleId)
           
static void reassignPermissions(long resourcePermissionId, long toRoleId)
           
static void removeResourcePermission(long companyId, String name, int scope, String primKey, long roleId, String actionId)
           
static void removeResourcePermissions(long companyId, String name, int scope, long roleId, String actionId)
           
static void setResourcePermissions(long companyId, String name, int scope, String primKey, long roleId, String[] actionIds)
           
 void setService(ResourcePermissionLocalService service)
           
static ResourcePermission updateResourcePermission(ResourcePermission resourcePermission)
          Updates the resource permission in the database.
static ResourcePermission updateResourcePermission(ResourcePermission resourcePermission, boolean merge)
          Updates the resource permission in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourcePermissionLocalServiceUtil

public ResourcePermissionLocalServiceUtil()
Method Detail

addResourcePermission

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

Parameters:
resourcePermission - the resource permission to add
Returns:
the resource permission that was added
Throws:
SystemException - if a system exception occurred

createResourcePermission

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

Parameters:
resourcePermissionId - the primary key for the new resource permission
Returns:
the new resource permission

deleteResourcePermission

public static void deleteResourcePermission(long resourcePermissionId)
                                     throws PortalException,
                                            SystemException
Deletes the resource permission with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
resourcePermissionId - the primary key of the resource permission to delete
Throws:
PortalException - if a resource permission with the primary key could not be found
SystemException - if a system exception occurred

deleteResourcePermission

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

Parameters:
resourcePermission - the resource permission to delete
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery)
                         throws SystemException
Performs a dynamic query on the database and returns the matching rows.

Parameters:
dynamicQuery - the dynamic query to search with
Returns:
the matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery,
                                int start,
                                int end)
                         throws SystemException
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.

Parameters:
dynamicQuery - the dynamic query to search with
start - the lower bound of the range of model instances to return
end - the upper bound of the range of model instances to return (not inclusive)
Returns:
the range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery,
                                int start,
                                int end,
                                OrderByComparator orderByComparator)
                         throws SystemException
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.

Parameters:
dynamicQuery - the dynamic query to search with
start - the lower bound of the range of model instances to return
end - the upper bound of the range of model instances to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQueryCount

public static long dynamicQueryCount(DynamicQuery dynamicQuery)
                              throws SystemException
Counts the number of rows that match the dynamic query.

Parameters:
dynamicQuery - the dynamic query to search with
Returns:
the number of rows that match the dynamic query
Throws:
SystemException - if a system exception occurred

getResourcePermission

public static ResourcePermission getResourcePermission(long resourcePermissionId)
                                                throws PortalException,
                                                       SystemException
Gets the resource permission with the primary key.

Parameters:
resourcePermissionId - the primary key of the resource permission to get
Returns:
the resource permission
Throws:
PortalException - if a resource permission with the primary key could not be found
SystemException - if a system exception occurred

getResourcePermissions

public static List<ResourcePermission> getResourcePermissions(int start,
                                                              int end)
                                                       throws SystemException
Gets 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.

Parameters:
start - the lower bound of the range of resource permissions to return
end - the upper bound of the range of resource permissions to return (not inclusive)
Returns:
the range of resource permissions
Throws:
SystemException - if a system exception occurred

getResourcePermissionsCount

public static int getResourcePermissionsCount()
                                       throws SystemException
Gets the number of resource permissions.

Returns:
the number of resource permissions
Throws:
SystemException - if a system exception occurred

updateResourcePermission

public static ResourcePermission updateResourcePermission(ResourcePermission resourcePermission)
                                                   throws SystemException
Updates the resource permission in the database. Also notifies the appropriate model listeners.

Parameters:
resourcePermission - the resource permission to update
Returns:
the resource permission that was updated
Throws:
SystemException - if a system exception occurred

updateResourcePermission

public static ResourcePermission updateResourcePermission(ResourcePermission resourcePermission,
                                                          boolean merge)
                                                   throws SystemException
Updates the resource permission in the database. Also notifies the appropriate model listeners.

Parameters:
resourcePermission - the resource permission to update
merge - whether to merge the resource permission with the current session. See BatchSession.update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean) for an explanation.
Returns:
the resource permission that was updated
Throws:
SystemException - if a system exception occurred

addResourcePermission

public static void addResourcePermission(long companyId,
                                         String name,
                                         int scope,
                                         String primKey,
                                         long roleId,
                                         String actionId)
                                  throws PortalException,
                                         SystemException
Throws:
PortalException
SystemException

getAvailableResourcePermissionActionIds

public static List<String> getAvailableResourcePermissionActionIds(long companyId,
                                                                   String name,
                                                                   int scope,
                                                                   String primKey,
                                                                   long roleId,
                                                                   List<String> actionIds)
                                                            throws PortalException,
                                                                   SystemException
Throws:
PortalException
SystemException

getResourcePermissions

public static List<ResourcePermission> getResourcePermissions(long companyId,
                                                              String name,
                                                              int scope,
                                                              String primKey)
                                                       throws SystemException
Throws:
SystemException

getResourcePermissionsCount

public static int getResourcePermissionsCount(long companyId,
                                              String name,
                                              int scope,
                                              String primKey)
                                       throws SystemException
Throws:
SystemException

getRoleResourcePermissions

public static List<ResourcePermission> getRoleResourcePermissions(long roleId)
                                                           throws SystemException
Throws:
SystemException

getRoleResourcePermissions

public static List<ResourcePermission> getRoleResourcePermissions(long roleId,
                                                                  int[] scopes,
                                                                  int start,
                                                                  int end)
                                                           throws SystemException
Throws:
SystemException

hasActionId

public static boolean hasActionId(ResourcePermission resourcePermission,
                                  ResourceAction resourceAction)

hasResourcePermission

public static boolean hasResourcePermission(long companyId,
                                            String name,
                                            int scope,
                                            String primKey,
                                            long roleId,
                                            String actionId)
                                     throws PortalException,
                                            SystemException
Throws:
PortalException
SystemException

hasScopeResourcePermission

public static boolean hasScopeResourcePermission(long companyId,
                                                 String name,
                                                 int scope,
                                                 long roleId,
                                                 String actionId)
                                          throws PortalException,
                                                 SystemException
Throws:
PortalException
SystemException

mergePermissions

public static void mergePermissions(long fromRoleId,
                                    long toRoleId)
                             throws PortalException,
                                    SystemException
Throws:
PortalException
SystemException

reassignPermissions

public static void reassignPermissions(long resourcePermissionId,
                                       long toRoleId)
                                throws PortalException,
                                       SystemException
Throws:
PortalException
SystemException

removeResourcePermission

public static void removeResourcePermission(long companyId,
                                            String name,
                                            int scope,
                                            String primKey,
                                            long roleId,
                                            String actionId)
                                     throws PortalException,
                                            SystemException
Throws:
PortalException
SystemException

removeResourcePermissions

public static void removeResourcePermissions(long companyId,
                                             String name,
                                             int scope,
                                             long roleId,
                                             String actionId)
                                      throws PortalException,
                                             SystemException
Throws:
PortalException
SystemException

setResourcePermissions

public static void setResourcePermissions(long companyId,
                                          String name,
                                          int scope,
                                          String primKey,
                                          long roleId,
                                          String[] actionIds)
                                   throws PortalException,
                                          SystemException
Throws:
PortalException
SystemException

getService

public static ResourcePermissionLocalService getService()

setService

public void setService(ResourcePermissionLocalService service)

Liferay 6.0-ee