001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    /**
018     * <p>
019     * This class is a wrapper for {@link PermissionService}.
020     * </p>
021     *
022     * @author    Brian Wing Shun Chan
023     * @see       PermissionService
024     * @generated
025     */
026    public class PermissionServiceWrapper implements PermissionService {
027            public PermissionServiceWrapper(PermissionService permissionService) {
028                    _permissionService = permissionService;
029            }
030    
031            /**
032            * Checks to see if the group has permission to the resource.
033            *
034            * @param groupId the primary key of the group
035            * @param resourceId the primary key of the resource
036            * @throws PortalException if the group did not have permission to the
037            resource, or if a group or resource with the primary key could
038            not be found or was invalid
039            * @throws SystemException if a system exception occurred
040            */
041            public void checkPermission(long groupId, long resourceId)
042                    throws com.liferay.portal.kernel.exception.PortalException,
043                            com.liferay.portal.kernel.exception.SystemException {
044                    _permissionService.checkPermission(groupId, resourceId);
045            }
046    
047            /**
048            * Checks to see if the group has permission to the service.
049            *
050            * @param groupId the primary key of the group
051            * @param name the service name
052            * @param primKey the primary key of the service
053            * @throws PortalException if the group did not have permission to the
054            service, if a group with the primary key could not be found or
055            if the permission information was invalid
056            * @throws SystemException if a system exception occurred
057            */
058            public void checkPermission(long groupId, java.lang.String name,
059                    long primKey)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    _permissionService.checkPermission(groupId, name, primKey);
063            }
064    
065            /**
066            * Checks to see if the group has permission to the service.
067            *
068            * @param groupId the primary key of the group
069            * @param name the service name
070            * @param primKey the primary key of the service
071            * @throws PortalException if the group did not have permission to the
072            service, if a group with the primary key could not be found or
073            if the permission information was invalid
074            * @throws SystemException if a system exception occurred
075            */
076            public void checkPermission(long groupId, java.lang.String name,
077                    java.lang.String primKey)
078                    throws com.liferay.portal.kernel.exception.PortalException,
079                            com.liferay.portal.kernel.exception.SystemException {
080                    _permissionService.checkPermission(groupId, name, primKey);
081            }
082    
083            /**
084            * Returns <code>true</code> if the group has permission to perform the
085            * action on the resource.
086            *
087            * @param groupId the primary key of the group
088            * @param actionId the action's ID
089            * @param resourceId the primary key of the resource
090            * @return <code>true</code> if the group has permission to perform the
091            action on the resource; <code>false</code> otherwise
092            * @throws SystemException if a system exception occurred
093            */
094            public boolean hasGroupPermission(long groupId, java.lang.String actionId,
095                    long resourceId)
096                    throws com.liferay.portal.kernel.exception.SystemException {
097                    return _permissionService.hasGroupPermission(groupId, actionId,
098                            resourceId);
099            }
100    
101            /**
102            * Returns <code>true</code> if the user has permission to perform the
103            * action on the resource.
104            *
105            * @param userId the primary key of the user
106            * @param actionId the action's ID
107            * @param resourceId the primary key of the resource
108            * @return <code>true</code> if the user has permission to perform the
109            action on the resource; <code>false</code> otherwise
110            * @throws SystemException if a system exception occurred
111            */
112            public boolean hasUserPermission(long userId, java.lang.String actionId,
113                    long resourceId)
114                    throws com.liferay.portal.kernel.exception.SystemException {
115                    return _permissionService.hasUserPermission(userId, actionId, resourceId);
116            }
117    
118            /**
119            * Returns <code>true</code> if the user has permission to perform the
120            * action on the resources.
121            *
122            * <p>
123            * This method does not support resources managed by the resource block
124            * system.
125            * </p>
126            *
127            * @param userId the primary key of the user
128            * @param groupId the primary key of the group containing the resource
129            * @param resources representations of the resource at each scope level
130            returned by {@link
131            com.liferay.portal.security.permission.AdvancedPermissionChecker#getResources(
132            long, long, String, String, String)}
133            * @param actionId the action's ID
134            * @param permissionCheckerBag the permission checker bag
135            * @return <code>true</code> if the user has permission to perform the
136            action on the resources; <code>false</code> otherwise
137            * @throws PortalException if a resource action based on any one of the
138            resources and the action ID could not be found
139            * @throws SystemException if a system exception occurred
140            */
141            public boolean hasUserPermissions(long userId, long groupId,
142                    java.util.List<com.liferay.portal.model.Resource> resources,
143                    java.lang.String actionId,
144                    com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
145                    throws com.liferay.portal.kernel.exception.PortalException,
146                            com.liferay.portal.kernel.exception.SystemException {
147                    return _permissionService.hasUserPermissions(userId, groupId,
148                            resources, actionId, permissionCheckerBag);
149            }
150    
151            /**
152            * Sets the group's permissions to perform the actions on the resource,
153            * replacing the group's existing permissions on the resource.
154            *
155            * @param groupId the primary key of the group
156            * @param actionIds the primary keys of the actions
157            * @param resourceId the primary key of the resource
158            * @throws PortalException if a group with the primary key could not be
159            found or if the group did not have permission to the resource
160            * @throws SystemException if a system exception occurred
161            */
162            public void setGroupPermissions(long groupId, java.lang.String[] actionIds,
163                    long resourceId)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException {
166                    _permissionService.setGroupPermissions(groupId, actionIds, resourceId);
167            }
168    
169            /**
170            * Sets the entity's group permissions to perform the actions on the
171            * resource, replacing the entity's existing group permissions on the
172            * resource. Only {@link com.liferay.portal.model.Organization} and {@link
173            * com.liferay.portal.model.UserGroup} class entities are supported.
174            *
175            * @param className the class name of an organization or user group
176            * @param classPK the primary key of the class
177            * @param groupId the primary key of the group
178            * @param actionIds the primary keys of the actions
179            * @param resourceId the primary key of the resource
180            * @throws PortalException if the group did not have permission to the
181            resource, if an entity with the class name and primary key could
182            not be found, or if the entity's associated group could not be
183            found
184            * @throws SystemException if a system exception occurred
185            */
186            public void setGroupPermissions(java.lang.String className,
187                    java.lang.String classPK, long groupId, java.lang.String[] actionIds,
188                    long resourceId)
189                    throws com.liferay.portal.kernel.exception.PortalException,
190                            com.liferay.portal.kernel.exception.SystemException {
191                    _permissionService.setGroupPermissions(className, classPK, groupId,
192                            actionIds, resourceId);
193            }
194    
195            /**
196            * Sets the permissions of each role to perform respective actions on the
197            * resource, replacing the existing permissions of each role on the
198            * resource.
199            *
200            * @param groupId the primary key of the group
201            * @param companyId the primary key of the company
202            * @param roleIdsToActionIds the map of roles to their new actions on the
203            resource
204            * @param resourceId the primary key of the resource
205            * @throws PortalException if the group did not have permission to the
206            resource
207            * @throws SystemException if a system exception occurred
208            */
209            public void setIndividualPermissions(long groupId, long companyId,
210                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds,
211                    long resourceId)
212                    throws com.liferay.portal.kernel.exception.PortalException,
213                            com.liferay.portal.kernel.exception.SystemException {
214                    _permissionService.setIndividualPermissions(groupId, companyId,
215                            roleIdsToActionIds, resourceId);
216            }
217    
218            /**
219            * Sets the organization permission to perform the actions on the resource
220            * for a particular group, replacing the organization's existing
221            * permissions on the resource.
222            *
223            * @param organizationId the primary key of the organization
224            * @param groupId the primary key of the group in which to scope the
225            permissions
226            * @param actionIds the primary keys of the actions
227            * @param resourceId the primary key of the resource
228            * @throws PortalException if the group did not have permission to the
229            resource or if an organization with the primary key could not be
230            found
231            * @throws SystemException if a system exception occurred
232            */
233            public void setOrgGroupPermissions(long organizationId, long groupId,
234                    java.lang.String[] actionIds, long resourceId)
235                    throws com.liferay.portal.kernel.exception.PortalException,
236                            com.liferay.portal.kernel.exception.SystemException {
237                    _permissionService.setOrgGroupPermissions(organizationId, groupId,
238                            actionIds, resourceId);
239            }
240    
241            /**
242            * Sets the role's permissions to perform the action on the named resource,
243            * replacing the role's existing permissions on the resource.
244            *
245            * @param roleId the primary key of the role
246            * @param groupId the primary key of the group
247            * @param name the resource name
248            * @param scope the resource scope
249            * @param primKey the resource primKey
250            * @param actionId the action's ID
251            * @throws PortalException if the group did not have permission to the role
252            or if the scope was {@link
253            com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL}
254            * @throws SystemException if a system exception occurred
255            */
256            public void setRolePermission(long roleId, long groupId,
257                    java.lang.String name, int scope, java.lang.String primKey,
258                    java.lang.String actionId)
259                    throws com.liferay.portal.kernel.exception.PortalException,
260                            com.liferay.portal.kernel.exception.SystemException {
261                    _permissionService.setRolePermission(roleId, groupId, name, scope,
262                            primKey, actionId);
263            }
264    
265            /**
266            * Sets the role's permissions to perform the actions on the resource,
267            * replacing the role's existing permissions on the resource.
268            *
269            * @param roleId the primary key of the role
270            * @param groupId the primary key of the group
271            * @param actionIds the primary keys of the actions
272            * @param resourceId the primary key of the resource
273            * @throws PortalException if the group did not have permission to the
274            resource or if a role with the primary key could not be found
275            * @throws SystemException if a system exception occurred
276            */
277            public void setRolePermissions(long roleId, long groupId,
278                    java.lang.String[] actionIds, long resourceId)
279                    throws com.liferay.portal.kernel.exception.PortalException,
280                            com.liferay.portal.kernel.exception.SystemException {
281                    _permissionService.setRolePermissions(roleId, groupId, actionIds,
282                            resourceId);
283            }
284    
285            /**
286            * Sets the user's permissions to perform the actions on the resource,
287            * replacing the user's existing permissions on the resource.
288            *
289            * @param userId the primary key of the user
290            * @param groupId the primary key of the group
291            * @param actionIds the primary keys of the actions
292            * @param resourceId the primary key of the resource
293            * @throws PortalException if the group did not have permission to the
294            resource or if a user with the primary key could not be found
295            * @throws SystemException if a system exception occurred
296            */
297            public void setUserPermissions(long userId, long groupId,
298                    java.lang.String[] actionIds, long resourceId)
299                    throws com.liferay.portal.kernel.exception.PortalException,
300                            com.liferay.portal.kernel.exception.SystemException {
301                    _permissionService.setUserPermissions(userId, groupId, actionIds,
302                            resourceId);
303            }
304    
305            /**
306            * Removes the permission from the role.
307            *
308            * @param roleId the primary key of the role
309            * @param groupId the primary key of the group
310            * @param permissionId the primary key of the permission
311            * @throws PortalException if the group did not have permission to the role
312            * @throws SystemException if a system exception occurred
313            */
314            public void unsetRolePermission(long roleId, long groupId, long permissionId)
315                    throws com.liferay.portal.kernel.exception.PortalException,
316                            com.liferay.portal.kernel.exception.SystemException {
317                    _permissionService.unsetRolePermission(roleId, groupId, permissionId);
318            }
319    
320            /**
321            * Removes the role's permissions to perform the action on the named
322            * resource with the scope and primKey.
323            *
324            * @param roleId the primary key of the role
325            * @param groupId the primary key of the group
326            * @param name the resource name
327            * @param scope the resource scope
328            * @param primKey the resource primKey
329            * @param actionId the action's ID
330            * @throws PortalException if the group did not have permission to the role
331            * @throws SystemException if a system exception occurred
332            */
333            public void unsetRolePermission(long roleId, long groupId,
334                    java.lang.String name, int scope, java.lang.String primKey,
335                    java.lang.String actionId)
336                    throws com.liferay.portal.kernel.exception.PortalException,
337                            com.liferay.portal.kernel.exception.SystemException {
338                    _permissionService.unsetRolePermission(roleId, groupId, name, scope,
339                            primKey, actionId);
340            }
341    
342            /**
343            * Removes the role's permissions to perform the action on the named
344            * resource.
345            *
346            * @param roleId the primary key of the role
347            * @param groupId the primary key of the group
348            * @param name the resource name
349            * @param scope the resource scope
350            * @param actionId the action's ID
351            * @throws PortalException if the group did not have permission to the role
352            * @throws SystemException if a system exception occurred
353            */
354            public void unsetRolePermissions(long roleId, long groupId,
355                    java.lang.String name, int scope, java.lang.String actionId)
356                    throws com.liferay.portal.kernel.exception.PortalException,
357                            com.liferay.portal.kernel.exception.SystemException {
358                    _permissionService.unsetRolePermissions(roleId, groupId, name, scope,
359                            actionId);
360            }
361    
362            /**
363            * Removes the user's permissions to perform the actions on the resource.
364            *
365            * @param userId the primary key of the user
366            * @param groupId the primary key of the group
367            * @param actionIds the primary keys of the actions
368            * @param resourceId the primary key of the resource
369            * @throws PortalException if the group did not have permission to the
370            resource
371            * @throws SystemException if a system exception occurred
372            */
373            public void unsetUserPermissions(long userId, long groupId,
374                    java.lang.String[] actionIds, long resourceId)
375                    throws com.liferay.portal.kernel.exception.PortalException,
376                            com.liferay.portal.kernel.exception.SystemException {
377                    _permissionService.unsetUserPermissions(userId, groupId, actionIds,
378                            resourceId);
379            }
380    
381            public PermissionService getWrappedPermissionService() {
382                    return _permissionService;
383            }
384    
385            public void setWrappedPermissionService(PermissionService permissionService) {
386                    _permissionService = permissionService;
387            }
388    
389            private PermissionService _permissionService;
390    }