001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.annotation.Isolation;
018    import com.liferay.portal.kernel.annotation.Propagation;
019    import com.liferay.portal.kernel.annotation.Transactional;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.exception.SystemException;
022    
023    /**
024     * The interface for the resource permission local service.
025     *
026     * <p>
027     * Never modify or reference this interface directly. Always use {@link ResourcePermissionLocalServiceUtil} to access the resource permission local service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
028     * </p>
029     *
030     * <p>
031     * 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.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ResourcePermissionLocalServiceUtil
036     * @see com.liferay.portal.service.base.ResourcePermissionLocalServiceBaseImpl
037     * @see com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl
038     * @generated
039     */
040    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface ResourcePermissionLocalService {
043            /**
044            * Adds the resource permission to the database. Also notifies the appropriate model listeners.
045            *
046            * @param resourcePermission the resource permission to add
047            * @return the resource permission that was added
048            * @throws SystemException if a system exception occurred
049            */
050            public com.liferay.portal.model.ResourcePermission addResourcePermission(
051                    com.liferay.portal.model.ResourcePermission resourcePermission)
052                    throws com.liferay.portal.kernel.exception.SystemException;
053    
054            /**
055            * Creates a new resource permission with the primary key. Does not add the resource permission to the database.
056            *
057            * @param resourcePermissionId the primary key for the new resource permission
058            * @return the new resource permission
059            */
060            public com.liferay.portal.model.ResourcePermission createResourcePermission(
061                    long resourcePermissionId);
062    
063            /**
064            * Deletes the resource permission with the primary key from the database. Also notifies the appropriate model listeners.
065            *
066            * @param resourcePermissionId the primary key of the resource permission to delete
067            * @throws PortalException if a resource permission with the primary key could not be found
068            * @throws SystemException if a system exception occurred
069            */
070            public void deleteResourcePermission(long resourcePermissionId)
071                    throws com.liferay.portal.kernel.exception.PortalException,
072                            com.liferay.portal.kernel.exception.SystemException;
073    
074            /**
075            * Deletes the resource permission from the database. Also notifies the appropriate model listeners.
076            *
077            * @param resourcePermission the resource permission to delete
078            * @throws SystemException if a system exception occurred
079            */
080            public void deleteResourcePermission(
081                    com.liferay.portal.model.ResourcePermission resourcePermission)
082                    throws com.liferay.portal.kernel.exception.SystemException;
083    
084            /**
085            * Performs a dynamic query on the database and returns the matching rows.
086            *
087            * @param dynamicQuery the dynamic query to search with
088            * @return the matching rows
089            * @throws SystemException if a system exception occurred
090            */
091            @SuppressWarnings("rawtypes")
092            public java.util.List dynamicQuery(
093                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
094                    throws com.liferay.portal.kernel.exception.SystemException;
095    
096            /**
097            * Performs a dynamic query on the database and returns a range of the matching rows.
098            *
099            * <p>
100            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
101            * </p>
102            *
103            * @param dynamicQuery the dynamic query to search with
104            * @param start the lower bound of the range of model instances to return
105            * @param end the upper bound of the range of model instances to return (not inclusive)
106            * @return the range of matching rows
107            * @throws SystemException if a system exception occurred
108            */
109            @SuppressWarnings("rawtypes")
110            public java.util.List dynamicQuery(
111                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
112                    int end) throws com.liferay.portal.kernel.exception.SystemException;
113    
114            /**
115            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
116            *
117            * <p>
118            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
119            * </p>
120            *
121            * @param dynamicQuery the dynamic query to search with
122            * @param start the lower bound of the range of model instances to return
123            * @param end the upper bound of the range of model instances to return (not inclusive)
124            * @param orderByComparator the comparator to order the results by
125            * @return the ordered range of matching rows
126            * @throws SystemException if a system exception occurred
127            */
128            @SuppressWarnings("rawtypes")
129            public java.util.List dynamicQuery(
130                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
131                    int end,
132                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
133                    throws com.liferay.portal.kernel.exception.SystemException;
134    
135            /**
136            * Counts the number of rows that match the dynamic query.
137            *
138            * @param dynamicQuery the dynamic query to search with
139            * @return the number of rows that match the dynamic query
140            * @throws SystemException if a system exception occurred
141            */
142            public long dynamicQueryCount(
143                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
144                    throws com.liferay.portal.kernel.exception.SystemException;
145    
146            /**
147            * Gets the resource permission with the primary key.
148            *
149            * @param resourcePermissionId the primary key of the resource permission to get
150            * @return the resource permission
151            * @throws PortalException if a resource permission with the primary key could not be found
152            * @throws SystemException if a system exception occurred
153            */
154            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155            public com.liferay.portal.model.ResourcePermission getResourcePermission(
156                    long resourcePermissionId)
157                    throws com.liferay.portal.kernel.exception.PortalException,
158                            com.liferay.portal.kernel.exception.SystemException;
159    
160            /**
161            * Gets a range of all the resource permissions.
162            *
163            * <p>
164            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
165            * </p>
166            *
167            * @param start the lower bound of the range of resource permissions to return
168            * @param end the upper bound of the range of resource permissions to return (not inclusive)
169            * @return the range of resource permissions
170            * @throws SystemException if a system exception occurred
171            */
172            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
173            public java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions(
174                    int start, int end)
175                    throws com.liferay.portal.kernel.exception.SystemException;
176    
177            /**
178            * Gets the number of resource permissions.
179            *
180            * @return the number of resource permissions
181            * @throws SystemException if a system exception occurred
182            */
183            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184            public int getResourcePermissionsCount()
185                    throws com.liferay.portal.kernel.exception.SystemException;
186    
187            /**
188            * Updates the resource permission in the database. Also notifies the appropriate model listeners.
189            *
190            * @param resourcePermission the resource permission to update
191            * @return the resource permission that was updated
192            * @throws SystemException if a system exception occurred
193            */
194            public com.liferay.portal.model.ResourcePermission updateResourcePermission(
195                    com.liferay.portal.model.ResourcePermission resourcePermission)
196                    throws com.liferay.portal.kernel.exception.SystemException;
197    
198            /**
199            * Updates the resource permission in the database. Also notifies the appropriate model listeners.
200            *
201            * @param resourcePermission the resource permission to update
202            * @param merge whether to merge the resource permission with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
203            * @return the resource permission that was updated
204            * @throws SystemException if a system exception occurred
205            */
206            public com.liferay.portal.model.ResourcePermission updateResourcePermission(
207                    com.liferay.portal.model.ResourcePermission resourcePermission,
208                    boolean merge)
209                    throws com.liferay.portal.kernel.exception.SystemException;
210    
211            public void addResourcePermission(long companyId, java.lang.String name,
212                    int scope, java.lang.String primKey, long roleId,
213                    java.lang.String actionId)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException;
216    
217            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
218            public java.util.List<java.lang.String> getAvailableResourcePermissionActionIds(
219                    long companyId, java.lang.String name, int scope,
220                    java.lang.String primKey, long roleId,
221                    java.util.List<java.lang.String> actionIds)
222                    throws com.liferay.portal.kernel.exception.PortalException,
223                            com.liferay.portal.kernel.exception.SystemException;
224    
225            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
226            public java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions(
227                    long companyId, java.lang.String name, int scope,
228                    java.lang.String primKey)
229                    throws com.liferay.portal.kernel.exception.SystemException;
230    
231            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
232            public int getResourcePermissionsCount(long companyId,
233                    java.lang.String name, int scope, java.lang.String primKey)
234                    throws com.liferay.portal.kernel.exception.SystemException;
235    
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions(
238                    long roleId) throws com.liferay.portal.kernel.exception.SystemException;
239    
240            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
241            public java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions(
242                    long roleId, int[] scopes, int start, int end)
243                    throws com.liferay.portal.kernel.exception.SystemException;
244    
245            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246            public boolean hasActionId(
247                    com.liferay.portal.model.ResourcePermission resourcePermission,
248                    com.liferay.portal.model.ResourceAction resourceAction);
249    
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public boolean hasResourcePermission(long companyId, java.lang.String name,
252                    int scope, java.lang.String primKey, long roleId,
253                    java.lang.String actionId)
254                    throws com.liferay.portal.kernel.exception.PortalException,
255                            com.liferay.portal.kernel.exception.SystemException;
256    
257            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258            public boolean hasScopeResourcePermission(long companyId,
259                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
260                    throws com.liferay.portal.kernel.exception.PortalException,
261                            com.liferay.portal.kernel.exception.SystemException;
262    
263            public void mergePermissions(long fromRoleId, long toRoleId)
264                    throws com.liferay.portal.kernel.exception.PortalException,
265                            com.liferay.portal.kernel.exception.SystemException;
266    
267            public void reassignPermissions(long resourcePermissionId, long toRoleId)
268                    throws com.liferay.portal.kernel.exception.PortalException,
269                            com.liferay.portal.kernel.exception.SystemException;
270    
271            public void removeResourcePermission(long companyId, java.lang.String name,
272                    int scope, java.lang.String primKey, long roleId,
273                    java.lang.String actionId)
274                    throws com.liferay.portal.kernel.exception.PortalException,
275                            com.liferay.portal.kernel.exception.SystemException;
276    
277            public void removeResourcePermissions(long companyId,
278                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
279                    throws com.liferay.portal.kernel.exception.PortalException,
280                            com.liferay.portal.kernel.exception.SystemException;
281    
282            public void setResourcePermissions(long companyId, java.lang.String name,
283                    int scope, java.lang.String primKey, long roleId,
284                    java.lang.String[] actionIds)
285                    throws com.liferay.portal.kernel.exception.PortalException,
286                            com.liferay.portal.kernel.exception.SystemException;
287    }