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.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 /** 020 * Provides a wrapper for {@link ResourceLocalService}. 021 * 022 * @author Brian Wing Shun Chan 023 * @see ResourceLocalService 024 * @generated 025 */ 026 @ProviderType 027 public class ResourceLocalServiceWrapper implements ResourceLocalService, 028 ServiceWrapper<ResourceLocalService> { 029 public ResourceLocalServiceWrapper( 030 ResourceLocalService resourceLocalService) { 031 _resourceLocalService = resourceLocalService; 032 } 033 034 /** 035 * Returns <code>true</code> if the roles have permission to perform the 036 * action on the resources. 037 * 038 * @param userId the primary key of the user performing the permission 039 check 040 * @param resourceId the primary key of the resource, typically the scope 041 group ID representing the scope in which the permission check is 042 being performed 043 * @param resources the resources for which permissions are to be checked 044 * @param actionId the primary key of the action to be performed on the 045 resources 046 * @param roleIds the primary keys of the roles 047 * @return <code>true</code> if the roles have permission to perform the 048 action on the resources;<code>false</code> otherwise 049 */ 050 @Override 051 public boolean hasUserPermissions(long userId, long resourceId, 052 java.util.List<com.liferay.portal.kernel.model.Resource> resources, 053 java.lang.String actionId, long[] roleIds) 054 throws com.liferay.portal.kernel.exception.PortalException { 055 return _resourceLocalService.hasUserPermissions(userId, resourceId, 056 resources, actionId, roleIds); 057 } 058 059 /** 060 * Returns a new resource with the name and primary key at the scope. 061 * 062 * @param companyId the primary key of the portal instance 063 * @param name a name for the resource, which should be a portlet ID if the 064 resource is a portlet or the resource's class name otherwise 065 * @param scope the scope of the resource. For more information see {@link 066 ResourceConstants}. 067 * @param primKey the primary key string of the resource 068 * @return the new resource 069 */ 070 @Override 071 public com.liferay.portal.kernel.model.Resource getResource( 072 long companyId, java.lang.String name, int scope, 073 java.lang.String primKey) { 074 return _resourceLocalService.getResource(companyId, name, scope, primKey); 075 } 076 077 /** 078 * Returns the OSGi service identifier. 079 * 080 * @return the OSGi service identifier 081 */ 082 @Override 083 public java.lang.String getOSGiServiceIdentifier() { 084 return _resourceLocalService.getOSGiServiceIdentifier(); 085 } 086 087 /** 088 * Adds resources for the model, always creating a resource at the 089 * individual scope and only creating resources at the group, group 090 * template, and company scope if such resources don't already exist. 091 * 092 * <ol> 093 * <li> 094 * If the service context specifies that default group or default guest 095 * permissions are to be added, then only default permissions are added. See 096 * {@link ServiceContext#setAddGroupPermissions( 097 * boolean)} and {@link 098 * ServiceContext#setAddGuestPermissions( 099 * boolean)}. 100 * </li> 101 * <li> 102 * Else ... 103 * <ol> 104 * <li> 105 * If the service context specifies to derive default permissions, then 106 * default group and guest permissions are derived from the model and 107 * added. See {@link 108 * ServiceContext#setDeriveDefaultPermissions( 109 * boolean)}. 110 * </li> 111 * <li> 112 * Lastly group and guest permissions from the service 113 * context are applied. See {@link 114 * ServiceContext#setGroupPermissions(String[])} 115 * and {@link 116 * ServiceContext#setGuestPermissions(String[])}. 117 * </li> 118 * </ol> 119 * 120 * </li> 121 * </ol> 122 * 123 * @param auditedModel the model to associate with the resources 124 * @param serviceContext the service context to apply. Can set whether to 125 add the model's default group and guest permissions, set whether 126 to derive default group and guest permissions from the model, set 127 group permissions to apply, and set guest permissions to apply. 128 */ 129 @Override 130 public void addModelResources( 131 com.liferay.portal.kernel.model.AuditedModel auditedModel, 132 ServiceContext serviceContext) 133 throws com.liferay.portal.kernel.exception.PortalException { 134 _resourceLocalService.addModelResources(auditedModel, serviceContext); 135 } 136 137 @Override 138 public void addModelResources(long companyId, long groupId, long userId, 139 java.lang.String name, java.lang.String primKey, 140 com.liferay.portal.kernel.service.permission.ModelPermissions modelPermissions) 141 throws com.liferay.portal.kernel.exception.PortalException { 142 _resourceLocalService.addModelResources(companyId, groupId, userId, 143 name, primKey, modelPermissions); 144 } 145 146 /** 147 * Adds resources for the model with the name and primary key string, always 148 * creating a resource at the individual scope and only creating resources 149 * at the group, group template, and company scope if such resources don't 150 * already exist. 151 * 152 * @param companyId the primary key of the portal instance 153 * @param groupId the primary key of the group 154 * @param userId the primary key of the user adding the resources 155 * @param name a name for the resource, typically the model's class name 156 * @param primKey the primary key string of the model instance, optionally 157 an empty string if no instance exists 158 * @param groupPermissions the group permissions to be applied 159 * @param guestPermissions the guest permissions to be applied 160 */ 161 @Override 162 public void addModelResources(long companyId, long groupId, long userId, 163 java.lang.String name, java.lang.String primKey, 164 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 165 throws com.liferay.portal.kernel.exception.PortalException { 166 _resourceLocalService.addModelResources(companyId, groupId, userId, 167 name, primKey, groupPermissions, guestPermissions); 168 } 169 170 @Override 171 public void addModelResources(long companyId, long groupId, long userId, 172 java.lang.String name, long primKey, 173 com.liferay.portal.kernel.service.permission.ModelPermissions modelPermissions) 174 throws com.liferay.portal.kernel.exception.PortalException { 175 _resourceLocalService.addModelResources(companyId, groupId, userId, 176 name, primKey, modelPermissions); 177 } 178 179 /** 180 * Adds resources for the model with the name and primary key, always 181 * creating a resource at the individual scope and only creating resources 182 * at the group, group template, and company scope if such resources don't 183 * already exist. 184 * 185 * @param companyId the primary key of the portal instance 186 * @param groupId the primary key of the group 187 * @param userId the primary key of the user adding the resources 188 * @param name a name for the resource, typically the model's class name 189 * @param primKey the primary key of the model instance, optionally 190 <code>0</code> if no instance exists 191 * @param groupPermissions the group permissions to be applied 192 * @param guestPermissions the guest permissions to be applied 193 */ 194 @Override 195 public void addModelResources(long companyId, long groupId, long userId, 196 java.lang.String name, long primKey, 197 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 198 throws com.liferay.portal.kernel.exception.PortalException { 199 _resourceLocalService.addModelResources(companyId, groupId, userId, 200 name, primKey, groupPermissions, guestPermissions); 201 } 202 203 /** 204 * Adds resources for the entity with the name. Use this method if the user 205 * is unknown or irrelevant and there is no current entity instance. 206 * 207 * @param companyId the primary key of the portal instance 208 * @param groupId the primary key of the group 209 * @param name a name for the resource, which should be a portlet ID if the 210 resource is a portlet or the resource's class name otherwise 211 * @param portletActions whether to associate portlet actions with the 212 resource 213 */ 214 @Override 215 public void addResources(long companyId, long groupId, 216 java.lang.String name, boolean portletActions) 217 throws com.liferay.portal.kernel.exception.PortalException { 218 _resourceLocalService.addResources(companyId, groupId, name, 219 portletActions); 220 } 221 222 /** 223 * Adds resources for the entity with the name and primary key string, 224 * always creating a resource at the individual scope and only creating 225 * resources at the group, group template, and company scope if such 226 * resources don't already exist. 227 * 228 * @param companyId the primary key of the portal instance 229 * @param groupId the primary key of the group 230 * @param userId the primary key of the user adding the resources 231 * @param name a name for the resource, which should be a portlet ID if the 232 resource is a portlet or the resource's class name otherwise 233 * @param primKey the primary key string of the resource instance, 234 optionally an empty string if no instance exists 235 * @param portletActions whether to associate portlet actions with the 236 resource 237 * @param addGroupPermissions whether to add group permissions 238 * @param addGuestPermissions whether to add guest permissions 239 */ 240 @Override 241 public void addResources(long companyId, long groupId, long userId, 242 java.lang.String name, java.lang.String primKey, 243 boolean portletActions, boolean addGroupPermissions, 244 boolean addGuestPermissions) 245 throws com.liferay.portal.kernel.exception.PortalException { 246 _resourceLocalService.addResources(companyId, groupId, userId, name, 247 primKey, portletActions, addGroupPermissions, addGuestPermissions); 248 } 249 250 /** 251 * Adds resources for the entity with the name and primary key, always 252 * creating a resource at the individual scope and only creating resources 253 * at the group, group template, and company scope if such resources don't 254 * already exist. 255 * 256 * @param companyId the primary key of the portal instance 257 * @param groupId the primary key of the group 258 * @param userId the primary key of the user adding the resources 259 * @param name a name for the resource, which should be a portlet ID if the 260 resource is a portlet or the resource's class name otherwise 261 * @param primKey the primary key of the resource instance, optionally 262 <code>0</code> if no instance exists 263 * @param portletActions whether to associate portlet actions with the 264 resource 265 * @param addGroupPermissions whether to add group permissions 266 * @param addGuestPermissions whether to add guest permissions 267 */ 268 @Override 269 public void addResources(long companyId, long groupId, long userId, 270 java.lang.String name, long primKey, boolean portletActions, 271 boolean addGroupPermissions, boolean addGuestPermissions) 272 throws com.liferay.portal.kernel.exception.PortalException { 273 _resourceLocalService.addResources(companyId, groupId, userId, name, 274 primKey, portletActions, addGroupPermissions, addGuestPermissions); 275 } 276 277 /** 278 * Deletes the resource associated with the model at the scope. 279 * 280 * @param auditedModel the model associated with the resource 281 * @param scope the scope of the resource. For more information see {@link 282 ResourceConstants}. 283 */ 284 @Override 285 public void deleteResource( 286 com.liferay.portal.kernel.model.AuditedModel auditedModel, int scope) 287 throws com.liferay.portal.kernel.exception.PortalException { 288 _resourceLocalService.deleteResource(auditedModel, scope); 289 } 290 291 /** 292 * Deletes the resource matching the primary key at the scope. 293 * 294 * @param companyId the primary key of the portal instance 295 * @param name the resource's name, which should be a portlet ID if the 296 resource is a portlet or the resource's class name otherwise 297 * @param scope the scope of the resource. For more information see {@link 298 ResourceConstants}. 299 * @param primKey the primary key string of the resource instance 300 */ 301 @Override 302 public void deleteResource(long companyId, java.lang.String name, 303 int scope, java.lang.String primKey) 304 throws com.liferay.portal.kernel.exception.PortalException { 305 _resourceLocalService.deleteResource(companyId, name, scope, primKey); 306 } 307 308 /** 309 * Deletes the resource matching the primary key at the scope. 310 * 311 * @param companyId the primary key of the portal instance 312 * @param name the resource's name, which should be a portlet ID if the 313 resource is a portlet or the resource's class name otherwise 314 * @param scope the scope of the resource. For more information see {@link 315 ResourceConstants}. 316 * @param primKey the primary key of the resource instance 317 */ 318 @Override 319 public void deleteResource(long companyId, java.lang.String name, 320 int scope, long primKey) 321 throws com.liferay.portal.kernel.exception.PortalException { 322 _resourceLocalService.deleteResource(companyId, name, scope, primKey); 323 } 324 325 /** 326 * Updates the resources for the model, replacing their group and guest 327 * permissions with new ones from the service context. 328 * 329 * @param auditedModel the model associated with the resources 330 * @param serviceContext the service context to be applied. Can set group 331 and guest permissions. 332 */ 333 @Override 334 public void updateModelResources( 335 com.liferay.portal.kernel.model.AuditedModel auditedModel, 336 ServiceContext serviceContext) 337 throws com.liferay.portal.kernel.exception.PortalException { 338 _resourceLocalService.updateModelResources(auditedModel, serviceContext); 339 } 340 341 /** 342 * Updates resources matching the name, primary key string and scope, 343 * replacing the primary key of their resource permissions with the new 344 * primary key. 345 * 346 * @param companyId the primary key of the portal instance 347 * @param name the resource's name, which should be a portlet ID if the 348 resource is a portlet or the resource's class name otherwise 349 * @param scope the scope of the resource. For more information see {@link 350 ResourceConstants}. 351 * @param primKey the primary key string of the resource instance 352 * @param newPrimKey the new primary key string of the resource 353 */ 354 @Override 355 public void updateResources(long companyId, java.lang.String name, 356 int scope, java.lang.String primKey, java.lang.String newPrimKey) { 357 _resourceLocalService.updateResources(companyId, name, scope, primKey, 358 newPrimKey); 359 } 360 361 /** 362 * Updates resources matching the group, name, and primary key string at the 363 * individual scope, setting new permissions. 364 * 365 * @param companyId the primary key of the portal instance 366 * @param groupId the primary key of the group 367 * @param name the resource's name, which should be a portlet ID if the 368 resource is a portlet or the resource's class name otherwise 369 * @param primKey the primary key string of the resource instance 370 * @param modelPermissions the model permissions to be applied 371 */ 372 @Override 373 public void updateResources(long companyId, long groupId, 374 java.lang.String name, java.lang.String primKey, 375 com.liferay.portal.kernel.service.permission.ModelPermissions modelPermissions) 376 throws com.liferay.portal.kernel.exception.PortalException { 377 _resourceLocalService.updateResources(companyId, groupId, name, 378 primKey, modelPermissions); 379 } 380 381 /** 382 * Updates resources matching the group, name, and primary key string at the 383 * individual scope, setting new group and guest permissions. 384 * 385 * @param companyId the primary key of the portal instance 386 * @param groupId the primary key of the group 387 * @param name the resource's name, which should be a portlet ID if the 388 resource is a portlet or the resource's class name otherwise 389 * @param primKey the primary key string of the resource instance 390 * @param groupPermissions the group permissions to be applied 391 * @param guestPermissions the guest permissions to be applied 392 */ 393 @Override 394 public void updateResources(long companyId, long groupId, 395 java.lang.String name, java.lang.String primKey, 396 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 397 throws com.liferay.portal.kernel.exception.PortalException { 398 _resourceLocalService.updateResources(companyId, groupId, name, 399 primKey, groupPermissions, guestPermissions); 400 } 401 402 /** 403 * Updates resources matching the group, name, and primary key at the 404 * individual scope, setting new permissions. 405 * 406 * @param companyId the primary key of the portal instance 407 * @param groupId the primary key of the group 408 * @param name the resource's name, which should be a portlet ID if the 409 resource is a portlet or the resource's class name otherwise 410 * @param primKey the primary key of the resource instance 411 * @param modelPermissions the model permissions to be applied 412 */ 413 @Override 414 public void updateResources(long companyId, long groupId, 415 java.lang.String name, long primKey, 416 com.liferay.portal.kernel.service.permission.ModelPermissions modelPermissions) 417 throws com.liferay.portal.kernel.exception.PortalException { 418 _resourceLocalService.updateResources(companyId, groupId, name, 419 primKey, modelPermissions); 420 } 421 422 /** 423 * Updates resources matching the group, name, and primary key at the 424 * individual scope, setting new group and guest permissions. 425 * 426 * @param companyId the primary key of the portal instance 427 * @param groupId the primary key of the group 428 * @param name the resource's name, which should be a portlet ID if the 429 resource is a portlet or the resource's class name otherwise 430 * @param primKey the primary key of the resource instance 431 * @param groupPermissions the group permissions to be applied 432 * @param guestPermissions the guest permissions to be applied 433 */ 434 @Override 435 public void updateResources(long companyId, long groupId, 436 java.lang.String name, long primKey, 437 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 438 throws com.liferay.portal.kernel.exception.PortalException { 439 _resourceLocalService.updateResources(companyId, groupId, name, 440 primKey, groupPermissions, guestPermissions); 441 } 442 443 @Override 444 public ResourceLocalService getWrappedService() { 445 return _resourceLocalService; 446 } 447 448 @Override 449 public void setWrappedService(ResourceLocalService resourceLocalService) { 450 _resourceLocalService = resourceLocalService; 451 } 452 453 private ResourceLocalService _resourceLocalService; 454 }