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