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            */
071            @Override
072            public void addResourcePermission(long groupId, long companyId,
073                    java.lang.String name, int scope, java.lang.String primKey,
074                    long roleId, java.lang.String actionId)
075                    throws com.liferay.portal.kernel.exception.PortalException {
076                    _resourcePermissionService.addResourcePermission(groupId, companyId,
077                            name, scope, primKey, roleId, actionId);
078            }
079    
080            /**
081            * Returns the OSGi service identifier.
082            *
083            * @return the OSGi service identifier
084            */
085            @Override
086            public java.lang.String getOSGiServiceIdentifier() {
087                    return _resourcePermissionService.getOSGiServiceIdentifier();
088            }
089    
090            /**
091            * Revokes permission at the scope from the role to perform the action on
092            * resources of the type. For example, this method could be used to revoke a
093            * group scope permission to edit blog posts.
094            *
095            * <p>
096            * Depending on the scope, the value of <code>primKey</code> will have
097            * different meanings. For more information, see {@link
098            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
099            * </p>
100            *
101            * @param groupId the primary key of the group
102            * @param companyId the primary key of the company
103            * @param name the resource's name, which can be either a class name or a
104            portlet ID
105            * @param scope the scope
106            * @param primKey the primary key
107            * @param roleId the primary key of the role
108            * @param actionId the action ID
109            */
110            @Override
111            public void removeResourcePermission(long groupId, long companyId,
112                    java.lang.String name, int scope, java.lang.String primKey,
113                    long roleId, java.lang.String actionId)
114                    throws com.liferay.portal.kernel.exception.PortalException {
115                    _resourcePermissionService.removeResourcePermission(groupId, companyId,
116                            name, scope, primKey, roleId, actionId);
117            }
118    
119            /**
120            * Revokes all permissions at the scope from the role to perform the action
121            * on resources of the type. For example, this method could be used to
122            * revoke all individual scope permissions to edit blog posts from site
123            * members.
124            *
125            * @param groupId the primary key of the group
126            * @param companyId the primary key of the company
127            * @param name the resource's name, which can be either a class name or a
128            portlet ID
129            * @param scope the scope
130            * @param roleId the primary key of the role
131            * @param actionId the action ID
132            */
133            @Override
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                    _resourcePermissionService.removeResourcePermissions(groupId,
138                            companyId, name, scope, roleId, actionId);
139            }
140    
141            /**
142            * Updates the role's permissions at the scope, setting the actions that can
143            * be performed on resources of the type. Existing actions are replaced.
144            *
145            * <p>
146            * This method can be used to set permissions at any scope, but it is
147            * generally only used at the individual scope. For example, it could be
148            * used to set the guest permissions on a blog post.
149            * </p>
150            *
151            * <p>
152            * Depending on the scope, the value of <code>primKey</code> will have
153            * different meanings. For more information, see {@link
154            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
155            * </p>
156            *
157            * @param groupId the primary key of the group
158            * @param companyId the primary key of the company
159            * @param name the resource's name, which can be either a class name or a
160            portlet ID
161            * @param primKey the primary key
162            * @param roleId the primary key of the role
163            * @param actionIds the action IDs of the actions
164            */
165            @Override
166            public void setIndividualResourcePermissions(long groupId, long companyId,
167                    java.lang.String name, java.lang.String primKey, long roleId,
168                    java.lang.String[] actionIds)
169                    throws com.liferay.portal.kernel.exception.PortalException {
170                    _resourcePermissionService.setIndividualResourcePermissions(groupId,
171                            companyId, name, primKey, roleId, actionIds);
172            }
173    
174            /**
175            * Updates the role's permissions at the scope, setting the actions that can
176            * be performed on resources of the type. Existing actions are replaced.
177            *
178            * <p>
179            * This method can be used to set permissions at any scope, but it is
180            * generally only used at the individual scope. For example, it could be
181            * used to set the guest permissions on a blog post.
182            * </p>
183            *
184            * <p>
185            * Depending on the scope, the value of <code>primKey</code> will have
186            * different meanings. For more information, see {@link
187            * com.liferay.portal.model.impl.ResourcePermissionImpl}.
188            * </p>
189            *
190            * @param groupId the primary key of the group
191            * @param companyId the primary key of the company
192            * @param name the resource's name, which can be either a class name or a
193            portlet ID
194            * @param primKey the primary key
195            * @param roleIdsToActionIds a map of role IDs to action IDs of the actions
196            */
197            @Override
198            public void setIndividualResourcePermissions(long groupId, long companyId,
199                    java.lang.String name, java.lang.String primKey,
200                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
201                    throws com.liferay.portal.kernel.exception.PortalException {
202                    _resourcePermissionService.setIndividualResourcePermissions(groupId,
203                            companyId, name, primKey, roleIdsToActionIds);
204            }
205    
206            @Override
207            public ResourcePermissionService getWrappedService() {
208                    return _resourcePermissionService;
209            }
210    
211            @Override
212            public void setWrappedService(
213                    ResourcePermissionService resourcePermissionService) {
214                    _resourcePermissionService = resourcePermissionService;
215            }
216    
217            private ResourcePermissionService _resourcePermissionService;
218    }