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