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 ResourcePermissionService}.
020     * </p>
021     *
022     * @author    Brian Wing Shun Chan
023     * @see       ResourcePermissionService
024     * @generated
025     */
026    public class ResourcePermissionServiceWrapper
027            implements ResourcePermissionService {
028            public ResourcePermissionServiceWrapper(
029                    ResourcePermissionService resourcePermissionService) {
030                    _resourcePermissionService = resourcePermissionService;
031            }
032    
033            /**
034            * Grants the role permission at the scope to perform the action on
035            * resources of the type. Existing actions are retained.
036            *
037            * <p>
038            * This method cannot be used to grant individual scope permissions, but is
039            * only intended for adding permissions at the company, group, and
040            * group-template scopes. For example, this method could be used to grant a
041            * company scope permission to edit message board posts.
042            * </p>
043            *
044            * <p>
045            * If a company scope permission is granted to resources that the role
046            * already had group scope permissions to, the group scope permissions are
047            * deleted. Likewise, if a group scope permission is granted to resources
048            * that the role already had company scope permissions to, the company
049            * scope permissions are deleted. Be aware that this latter behavior can
050            * result in an overall reduction in permissions for the role.
051            * </p>
052            *
053            * <p>
054            * Depending on the scope, the value of <code>primKey</code> will have
055            * different meanings. For more information, see {@link
056            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
057            * </p>
058            *
059            * @param groupId the primary key of the group
060            * @param companyId the primary key of the company
061            * @param name the resource's name, which can be either a class name or a
062            portlet ID
063            * @param scope the scope. This method only supports company, group, and
064            group-template scope.
065            * @param primKey the primary key
066            * @param roleId the primary key of the role
067            * @param actionId the action ID
068            * @throws PortalException if the user did not have permission to add
069            resource permissions, or if scope was set to individual scope or
070            if a role with the primary key or a resource action with the
071            name and action ID could not be found
072            * @throws SystemException if a system exception occurred
073            */
074            public void addResourcePermission(long groupId, long companyId,
075                    java.lang.String name, int scope, java.lang.String primKey,
076                    long roleId, java.lang.String actionId)
077                    throws com.liferay.portal.kernel.exception.PortalException,
078                            com.liferay.portal.kernel.exception.SystemException {
079                    _resourcePermissionService.addResourcePermission(groupId, companyId,
080                            name, scope, primKey, roleId, actionId);
081            }
082    
083            /**
084            * Revokes permission at the scope from the role to perform the action on
085            * resources of the type. For example, this method could be used to revoke
086            * a group scope permission to edit blog posts.
087            *
088            * <p>
089            * Depending on the scope, the value of <code>primKey</code> will have
090            * different meanings. For more information, see {@link
091            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
092            * </p>
093            *
094            * @param groupId the primary key of the group
095            * @param companyId the primary key of the company
096            * @param name the resource's name, which can be either a class name or a
097            portlet ID
098            * @param scope the scope
099            * @param primKey the primary key
100            * @param roleId the primary key of the role
101            * @param actionId the action ID
102            * @throws PortalException if the user did not have permission to remove
103            resource permissions, or if a role with the primary key or a
104            resource action with the name and action ID could not be found
105            * @throws SystemException if a system exception occurred
106            */
107            public void removeResourcePermission(long groupId, long companyId,
108                    java.lang.String name, int scope, java.lang.String primKey,
109                    long roleId, java.lang.String actionId)
110                    throws com.liferay.portal.kernel.exception.PortalException,
111                            com.liferay.portal.kernel.exception.SystemException {
112                    _resourcePermissionService.removeResourcePermission(groupId, companyId,
113                            name, scope, primKey, roleId, actionId);
114            }
115    
116            /**
117            * Revokes all permissions at the scope from the role to perform the action
118            * on resources of the type. For example, this method could be used to
119            * revoke all individual scope permissions to edit blog posts from site
120            * members.
121            *
122            * @param groupId the primary key of the group
123            * @param companyId the primary key of the company
124            * @param name the resource's name, which can be either a class name or a
125            portlet ID
126            * @param scope the scope
127            * @param roleId the primary key of the role
128            * @param actionId the action ID
129            * @throws PortalException if the user did not have permission to remove
130            resource permissions, or if a role with the primary key or a
131            resource action with the name and action ID could not be found
132            * @throws SystemException if a system exception occurred
133            */
134            public void removeResourcePermissions(long groupId, long companyId,
135                    java.lang.String name, int scope, long roleId, java.lang.String actionId)
136                    throws com.liferay.portal.kernel.exception.PortalException,
137                            com.liferay.portal.kernel.exception.SystemException {
138                    _resourcePermissionService.removeResourcePermissions(groupId,
139                            companyId, name, scope, roleId, actionId);
140            }
141    
142            /**
143            * Updates the role's permissions at the scope, setting the actions that
144            * can be performed on resources of the type. Existing actions are
145            * replaced.
146            *
147            * <p>
148            * This method can be used to set permissions at any scope, but it is
149            * generally only used at the individual scope. For example, it could be
150            * used to set the guest permissions on a blog post.
151            * </p>
152            *
153            * <p>
154            * Depending on the scope, the value of <code>primKey</code> will have
155            * different meanings. For more information, see {@link
156            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
157            * </p>
158            *
159            * @param groupId the primary key of the group
160            * @param companyId the primary key of the company
161            * @param name the resource's name, which can be either a class name or a
162            portlet ID
163            * @param primKey the primary key
164            * @param roleId the primary key of the role
165            * @param actionIds the action IDs of the actions
166            * @throws PortalException if the user did not have permission to set
167            resource permissions, or if a role with the primary key or a
168            resource action with the name and action ID could not be found
169            * @throws SystemException if a system exception occurred
170            */
171            public void setIndividualResourcePermissions(long groupId, long companyId,
172                    java.lang.String name, java.lang.String primKey, long roleId,
173                    java.lang.String[] actionIds)
174                    throws com.liferay.portal.kernel.exception.PortalException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    _resourcePermissionService.setIndividualResourcePermissions(groupId,
177                            companyId, name, primKey, roleId, actionIds);
178            }
179    
180            /**
181            * Updates the role's permissions at the scope, setting the actions that
182            * can be performed on resources of the type. Existing actions are
183            * replaced.
184            *
185            * <p>
186            * This method can be used to set permissions at any scope, but it is
187            * generally only used at the individual scope. For example, it could be
188            * used to set the guest permissions on a blog post.
189            * </p>
190            *
191            * <p>
192            * Depending on the scope, the value of <code>primKey</code> will have
193            * different meanings. For more information, see {@link
194            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
195            * </p>
196            *
197            * @param groupId the primary key of the group
198            * @param companyId the primary key of the company
199            * @param name the resource's name, which can be either a class name or a
200            portlet ID
201            * @param primKey the primary key
202            * @param roleIdsToActionIds a map of role IDs to action IDs of the
203            actions
204            * @throws PortalException if the user did not have permission to set
205            resource permissions, or if a role with the primary key or a
206            resource action with the name and action ID could not be found
207            * @throws SystemException if a system exception occurred
208            */
209            public void setIndividualResourcePermissions(long groupId, long companyId,
210                    java.lang.String name, java.lang.String primKey,
211                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
212                    throws com.liferay.portal.kernel.exception.PortalException,
213                            com.liferay.portal.kernel.exception.SystemException {
214                    _resourcePermissionService.setIndividualResourcePermissions(groupId,
215                            companyId, name, primKey, roleIdsToActionIds);
216            }
217    
218            public ResourcePermissionService getWrappedResourcePermissionService() {
219                    return _resourcePermissionService;
220            }
221    
222            public void setWrappedResourcePermissionService(
223                    ResourcePermissionService resourcePermissionService) {
224                    _resourcePermissionService = resourcePermissionService;
225            }
226    
227            private ResourcePermissionService _resourcePermissionService;
228    }