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