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 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.exception.PortalException; 020 import com.liferay.portal.kernel.exception.SystemException; 021 import com.liferay.portal.kernel.transaction.Isolation; 022 import com.liferay.portal.kernel.transaction.Propagation; 023 import com.liferay.portal.kernel.transaction.Transactional; 024 025 /** 026 * Provides the local service interface for ResourcePermission. Methods of this 027 * service will not have security checks based on the propagated JAAS 028 * credentials because this service can only be accessed from within the same 029 * VM. 030 * 031 * @author Brian Wing Shun Chan 032 * @see ResourcePermissionLocalServiceUtil 033 * @see com.liferay.portal.service.base.ResourcePermissionLocalServiceBaseImpl 034 * @see com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl 035 * @generated 036 */ 037 @ProviderType 038 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 039 PortalException.class, SystemException.class}) 040 public interface ResourcePermissionLocalService extends BaseLocalService, 041 PersistedModelLocalService { 042 /* 043 * NOTE FOR DEVELOPERS: 044 * 045 * Never modify or reference this interface directly. Always use {@link ResourcePermissionLocalServiceUtil} to access the resource permission local service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 046 */ 047 048 /** 049 * Adds the resource permission to the database. Also notifies the appropriate model listeners. 050 * 051 * @param resourcePermission the resource permission 052 * @return the resource permission that was added 053 * @throws SystemException if a system exception occurred 054 */ 055 public com.liferay.portal.model.ResourcePermission addResourcePermission( 056 com.liferay.portal.model.ResourcePermission resourcePermission) 057 throws com.liferay.portal.kernel.exception.SystemException; 058 059 /** 060 * Creates a new resource permission with the primary key. Does not add the resource permission to the database. 061 * 062 * @param resourcePermissionId the primary key for the new resource permission 063 * @return the new resource permission 064 */ 065 public com.liferay.portal.model.ResourcePermission createResourcePermission( 066 long resourcePermissionId); 067 068 /** 069 * Deletes the resource permission with the primary key from the database. Also notifies the appropriate model listeners. 070 * 071 * @param resourcePermissionId the primary key of the resource permission 072 * @return the resource permission that was removed 073 * @throws PortalException if a resource permission with the primary key could not be found 074 * @throws SystemException if a system exception occurred 075 */ 076 public com.liferay.portal.model.ResourcePermission deleteResourcePermission( 077 long resourcePermissionId) 078 throws com.liferay.portal.kernel.exception.PortalException, 079 com.liferay.portal.kernel.exception.SystemException; 080 081 /** 082 * Deletes the resource permission from the database. Also notifies the appropriate model listeners. 083 * 084 * @param resourcePermission the resource permission 085 * @return the resource permission that was removed 086 * @throws SystemException if a system exception occurred 087 */ 088 public com.liferay.portal.model.ResourcePermission deleteResourcePermission( 089 com.liferay.portal.model.ResourcePermission resourcePermission) 090 throws com.liferay.portal.kernel.exception.SystemException; 091 092 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 093 094 /** 095 * Performs a dynamic query on the database and returns the matching rows. 096 * 097 * @param dynamicQuery the dynamic query 098 * @return the matching rows 099 * @throws SystemException if a system exception occurred 100 */ 101 @SuppressWarnings("rawtypes") 102 public java.util.List dynamicQuery( 103 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 104 throws com.liferay.portal.kernel.exception.SystemException; 105 106 /** 107 * Performs a dynamic query on the database and returns a range of the matching rows. 108 * 109 * <p> 110 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 111 * </p> 112 * 113 * @param dynamicQuery the dynamic query 114 * @param start the lower bound of the range of model instances 115 * @param end the upper bound of the range of model instances (not inclusive) 116 * @return the range of matching rows 117 * @throws SystemException if a system exception occurred 118 */ 119 @SuppressWarnings("rawtypes") 120 public java.util.List dynamicQuery( 121 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 122 int end) throws com.liferay.portal.kernel.exception.SystemException; 123 124 /** 125 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 126 * 127 * <p> 128 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 129 * </p> 130 * 131 * @param dynamicQuery the dynamic query 132 * @param start the lower bound of the range of model instances 133 * @param end the upper bound of the range of model instances (not inclusive) 134 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 135 * @return the ordered range of matching rows 136 * @throws SystemException if a system exception occurred 137 */ 138 @SuppressWarnings("rawtypes") 139 public java.util.List dynamicQuery( 140 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 141 int end, 142 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 143 throws com.liferay.portal.kernel.exception.SystemException; 144 145 /** 146 * Returns the number of rows that match the dynamic query. 147 * 148 * @param dynamicQuery the dynamic query 149 * @return the number of rows that match the dynamic query 150 * @throws SystemException if a system exception occurred 151 */ 152 public long dynamicQueryCount( 153 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 154 throws com.liferay.portal.kernel.exception.SystemException; 155 156 /** 157 * Returns the number of rows that match the dynamic query. 158 * 159 * @param dynamicQuery the dynamic query 160 * @param projection the projection to apply to the query 161 * @return the number of rows that match the dynamic query 162 * @throws SystemException if a system exception occurred 163 */ 164 public long dynamicQueryCount( 165 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 166 com.liferay.portal.kernel.dao.orm.Projection projection) 167 throws com.liferay.portal.kernel.exception.SystemException; 168 169 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 170 public com.liferay.portal.model.ResourcePermission fetchResourcePermission( 171 long resourcePermissionId) 172 throws com.liferay.portal.kernel.exception.SystemException; 173 174 /** 175 * Returns the resource permission with the primary key. 176 * 177 * @param resourcePermissionId the primary key of the resource permission 178 * @return the resource permission 179 * @throws PortalException if a resource permission with the primary key could not be found 180 * @throws SystemException if a system exception occurred 181 */ 182 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 183 public com.liferay.portal.model.ResourcePermission getResourcePermission( 184 long resourcePermissionId) 185 throws com.liferay.portal.kernel.exception.PortalException, 186 com.liferay.portal.kernel.exception.SystemException; 187 188 @Override 189 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 190 public com.liferay.portal.model.PersistedModel getPersistedModel( 191 java.io.Serializable primaryKeyObj) 192 throws com.liferay.portal.kernel.exception.PortalException, 193 com.liferay.portal.kernel.exception.SystemException; 194 195 /** 196 * Returns a range of all the resource permissions. 197 * 198 * <p> 199 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourcePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 200 * </p> 201 * 202 * @param start the lower bound of the range of resource permissions 203 * @param end the upper bound of the range of resource permissions (not inclusive) 204 * @return the range of resource permissions 205 * @throws SystemException if a system exception occurred 206 */ 207 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 208 public java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions( 209 int start, int end) 210 throws com.liferay.portal.kernel.exception.SystemException; 211 212 /** 213 * Returns the number of resource permissions. 214 * 215 * @return the number of resource permissions 216 * @throws SystemException if a system exception occurred 217 */ 218 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 219 public int getResourcePermissionsCount() 220 throws com.liferay.portal.kernel.exception.SystemException; 221 222 /** 223 * Updates the resource permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 224 * 225 * @param resourcePermission the resource permission 226 * @return the resource permission that was updated 227 * @throws SystemException if a system exception occurred 228 */ 229 public com.liferay.portal.model.ResourcePermission updateResourcePermission( 230 com.liferay.portal.model.ResourcePermission resourcePermission) 231 throws com.liferay.portal.kernel.exception.SystemException; 232 233 /** 234 * Returns the Spring bean ID for this bean. 235 * 236 * @return the Spring bean ID for this bean 237 */ 238 public java.lang.String getBeanIdentifier(); 239 240 /** 241 * Sets the Spring bean ID for this bean. 242 * 243 * @param beanIdentifier the Spring bean ID for this bean 244 */ 245 public void setBeanIdentifier(java.lang.String beanIdentifier); 246 247 /** 248 * Grants the role permission at the scope to perform the action on 249 * resources of the type. Existing actions are retained. 250 * 251 * <p> 252 * This method cannot be used to grant individual scope permissions, but is 253 * only intended for adding permissions at the company, group, and 254 * group-template scopes. For example, this method could be used to grant a 255 * company scope permission to edit message board posts. 256 * </p> 257 * 258 * <p> 259 * If a company scope permission is granted to resources that the role 260 * already had group scope permissions to, the group scope permissions are 261 * deleted. Likewise, if a group scope permission is granted to resources 262 * that the role already had company scope permissions to, the company scope 263 * permissions are deleted. Be aware that this latter behavior can result in 264 * an overall reduction in permissions for the role. 265 * </p> 266 * 267 * <p> 268 * Depending on the scope, the value of <code>primKey</code> will have 269 * different meanings. For more information, see {@link 270 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 271 * </p> 272 * 273 * @param companyId the primary key of the company 274 * @param name the resource's name, which can be either a class name or a 275 portlet ID 276 * @param scope the scope. This method only supports company, group, and 277 group-template scope. 278 * @param primKey the primary key 279 * @param roleId the primary key of the role 280 * @param actionId the action ID 281 * @throws PortalException if scope was set to individual scope or if a role 282 with the primary key or a resource action with the name and 283 action ID could not be found 284 * @throws SystemException if a system exception occurred 285 */ 286 public void addResourcePermission(long companyId, java.lang.String name, 287 int scope, java.lang.String primKey, long roleId, 288 java.lang.String actionId) 289 throws com.liferay.portal.kernel.exception.PortalException, 290 com.liferay.portal.kernel.exception.SystemException; 291 292 /** 293 * Grants the role permissions at the scope to perform the actions on all 294 * resources of the type. Existing actions are retained. 295 * 296 * <p> 297 * This method should only be used to add default permissions to existing 298 * resources en masse during upgrades or while verifying permissions. For 299 * example, this method could be used to grant site members individual scope 300 * permissions to view all blog posts. 301 * </p> 302 * 303 * @param resourceName the resource's name, which can be either a class 304 name or a portlet ID 305 * @param roleName the role's name 306 * @param scope the scope 307 * @param resourceActionBitwiseValue the bitwise IDs of the actions 308 * @throws SystemException if a system exception occurred 309 */ 310 public void addResourcePermissions(java.lang.String resourceName, 311 java.lang.String roleName, int scope, long resourceActionBitwiseValue) 312 throws com.liferay.portal.kernel.exception.SystemException; 313 314 /** 315 * Deletes all resource permissions at the scope to resources of the type. 316 * This method should not be confused with any of the 317 * <code>removeResourcePermission</code> methods, as its purpose is very 318 * different. This method should only be used for deleting resource 319 * permissions that refer to a resource when that resource is deleted. For 320 * example this method could be used to delete all individual scope 321 * permissions to a blog post when it is deleted. 322 * 323 * <p> 324 * Depending on the scope, the value of <code>primKey</code> will have 325 * different meanings. For more information, see {@link 326 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 327 * </p> 328 * 329 * @param companyId the primary key of the company 330 * @param name the resource's name, which can be either a class name or a 331 portlet ID 332 * @param scope the scope 333 * @param primKey the primary key 334 * @throws PortalException if a portal exception occurred 335 * @throws SystemException if a system exception occurred 336 */ 337 public void deleteResourcePermissions(long companyId, 338 java.lang.String name, int scope, long primKey) 339 throws com.liferay.portal.kernel.exception.PortalException, 340 com.liferay.portal.kernel.exception.SystemException; 341 342 /** 343 * Deletes all resource permissions at the scope to resources of the type. 344 * This method should not be confused with any of the 345 * <code>removeResourcePermission</code> methods, as its purpose is very 346 * different. This method should only be used for deleting resource 347 * permissions that refer to a resource when that resource is deleted. For 348 * example this method could be used to delete all individual scope 349 * permissions to a blog post when it is deleted. 350 * 351 * <p> 352 * Depending on the scope, the value of <code>primKey</code> will have 353 * different meanings. For more information, see {@link 354 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 355 * </p> 356 * 357 * @param companyId the primary key of the company 358 * @param name the resource's name, which can be either a class name or a 359 portlet ID 360 * @param scope the scope 361 * @param primKey the primary key 362 * @throws PortalException if a portal exception occurred 363 * @throws SystemException if a system exception occurred 364 */ 365 public void deleteResourcePermissions(long companyId, 366 java.lang.String name, int scope, java.lang.String primKey) 367 throws com.liferay.portal.kernel.exception.PortalException, 368 com.liferay.portal.kernel.exception.SystemException; 369 370 /** 371 * Returns the intersection of action IDs the role has permission at the 372 * scope to perform on resources of the type. 373 * 374 * @param companyId he primary key of the company 375 * @param name the resource's name, which can be either a class name or a 376 portlet ID 377 * @param scope the scope 378 * @param primKey the primary key 379 * @param roleId the primary key of the role 380 * @param actionIds the action IDs 381 * @return the intersection of action IDs the role has permission at the 382 scope to perform on resources of the type 383 * @throws PortalException if a resouce action could not be found for any 384 one of the actions on the resource 385 * @throws SystemException if a system exception occurred 386 */ 387 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 388 public java.util.List<java.lang.String> getAvailableResourcePermissionActionIds( 389 long companyId, java.lang.String name, int scope, 390 java.lang.String primKey, long roleId, 391 java.util.Collection<java.lang.String> actionIds) 392 throws com.liferay.portal.kernel.exception.PortalException, 393 com.liferay.portal.kernel.exception.SystemException; 394 395 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 396 public java.util.Map<java.lang.Long, java.util.Set<java.lang.String>> getAvailableResourcePermissionActionIds( 397 long companyId, java.lang.String name, int scope, 398 java.lang.String primKey, long[] roleIds, 399 java.util.Collection<java.lang.String> actionIds) 400 throws com.liferay.portal.kernel.exception.PortalException, 401 com.liferay.portal.kernel.exception.SystemException; 402 403 /** 404 * Returns the resource permission for the role at the scope to perform the 405 * actions on resources of the type. 406 * 407 * @param companyId the primary key of the company 408 * @param name the resource's name, which can be either a class name or a 409 portlet ID 410 * @param scope the scope 411 * @param primKey the primary key 412 * @param roleId the primary key of the role 413 * @return the resource permission for the role at the scope to perform the 414 actions on resources of the type 415 * @throws PortalException if no matching resources could be found 416 * @throws SystemException if a system exception occurred 417 */ 418 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 419 public com.liferay.portal.model.ResourcePermission getResourcePermission( 420 long companyId, java.lang.String name, int scope, 421 java.lang.String primKey, long roleId) 422 throws com.liferay.portal.kernel.exception.PortalException, 423 com.liferay.portal.kernel.exception.SystemException; 424 425 /** 426 * Returns all the resource permissions at the scope of the type. 427 * 428 * @param companyId the primary key of the company 429 * @param name the resource's name, which can be either a class name or a 430 portlet ID 431 * @param scope the scope 432 * @param primKey the primary key 433 * @return the resource permissions at the scope of the type 434 * @throws SystemException if a system exception occurred 435 */ 436 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 437 public java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions( 438 long companyId, java.lang.String name, int scope, 439 java.lang.String primKey) 440 throws com.liferay.portal.kernel.exception.SystemException; 441 442 /** 443 * Returns the number of resource permissions at the scope of the type. 444 * 445 * @param companyId the primary key of the company 446 * @param name the resource's name, which can be either a class name or a 447 portlet ID 448 * @param scope the scope 449 * @param primKey the primary key 450 * @return the number of resource permissions at the scope of the type 451 * @throws SystemException if a system exception occurred 452 */ 453 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 454 public int getResourcePermissionsCount(long companyId, 455 java.lang.String name, int scope, java.lang.String primKey) 456 throws com.liferay.portal.kernel.exception.SystemException; 457 458 /** 459 * Returns the resource permissions that apply to the resource. 460 * 461 * @param companyId the primary key of the resource's company 462 * @param groupId the primary key of the resource's group 463 * @param name the resource's name, which can be either a class name or a 464 portlet ID 465 * @param primKey the primary key of the resource 466 * @return the resource permissions associated with the resource 467 * @throws SystemException if a system exception occurred 468 */ 469 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 470 public java.util.List<com.liferay.portal.model.ResourcePermission> getResourceResourcePermissions( 471 long companyId, long groupId, java.lang.String name, 472 java.lang.String primKey) 473 throws com.liferay.portal.kernel.exception.SystemException; 474 475 /** 476 * Returns all the resource permissions for the role. 477 * 478 * @param roleId the primary key of the role 479 * @return the resource permissions for the role 480 * @throws SystemException if a system exception occurred 481 */ 482 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 483 public java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions( 484 long roleId) throws com.liferay.portal.kernel.exception.SystemException; 485 486 /** 487 * Returns a range of all the resource permissions for the role at the 488 * scopes. 489 * 490 * <p> 491 * Useful when paginating results. Returns a maximum of <code>end - 492 * start</code> instances. <code>start</code> and <code>end</code> are not 493 * primary keys, they are indexes in the result set. Thus, <code>0</code> 494 * refers to the first result in the set. Setting both <code>start</code> 495 * and <code>end</code> to {@link 496 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 497 * result set. 498 * </p> 499 * 500 * @param roleId the primary key of the role 501 * @param scopes the scopes 502 * @param start the lower bound of the range of results 503 * @param end the upper bound of the range of results (not inclusive) 504 * @return the range of resource permissions for the role at the scopes 505 * @throws SystemException if a system exception occurred 506 */ 507 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 508 public java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions( 509 long roleId, int[] scopes, int start, int end) 510 throws com.liferay.portal.kernel.exception.SystemException; 511 512 /** 513 * Returns all the resource permissions where scope = any ?. 514 * 515 * <p> 516 * Useful when paginating results. Returns a maximum of <code>end - 517 * start</code> instances. <code>start</code> and <code>end</code> are not 518 * primary keys, they are indexes in the result set. Thus, <code>0</code> 519 * refers to the first result in the set. Setting both <code>start</code> 520 * and <code>end</code> to {@link 521 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 522 * result set. 523 * </p> 524 * 525 * @param scopes the scopes 526 * @return the resource permissions where scope = any ? 527 * @throws SystemException if a system exception occurred 528 */ 529 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 530 public java.util.List<com.liferay.portal.model.ResourcePermission> getScopeResourcePermissions( 531 int[] scopes) 532 throws com.liferay.portal.kernel.exception.SystemException; 533 534 /** 535 * Returns <code>true</code> if the resource permission grants permission to 536 * perform the resource action. Note that this method does not ensure that 537 * the resource permission refers to the same type of resource as the 538 * resource action. 539 * 540 * @param resourcePermission the resource permission 541 * @param resourceAction the resource action 542 * @return <code>true</code> if the resource permission grants permission to 543 perform the resource action 544 */ 545 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 546 public boolean hasActionId( 547 com.liferay.portal.model.ResourcePermission resourcePermission, 548 com.liferay.portal.model.ResourceAction resourceAction); 549 550 /** 551 * Returns <code>true</code> if the roles have permission at the scope to 552 * perform the action on the resources. 553 * 554 * <p> 555 * Depending on the scope, the value of <code>primKey</code> will have 556 * different meanings. For more information, see {@link 557 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 558 * </p> 559 * 560 * @param resources the resources 561 * @param roleIds the primary keys of the roles 562 * @param actionId the action ID 563 * @return <code>true</code> if any one of the roles has permission to 564 perform the action on any one of the resources; 565 <code>false</code> otherwise 566 * @throws PortalException if any one of the roles with the primary keys 567 could not be found or if a resource action with the name and 568 action ID could not be found 569 * @throws SystemException if a system exception occurred 570 */ 571 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 572 public boolean hasResourcePermission( 573 java.util.List<com.liferay.portal.model.Resource> resources, 574 long[] roleIds, java.lang.String actionId) 575 throws com.liferay.portal.kernel.exception.PortalException, 576 com.liferay.portal.kernel.exception.SystemException; 577 578 /** 579 * Returns <code>true</code> if the role has permission at the scope to 580 * perform the action on resources of the type. 581 * 582 * <p> 583 * Depending on the scope, the value of <code>primKey</code> will have 584 * different meanings. For more information, see {@link 585 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 586 * </p> 587 * 588 * @param companyId the primary key of the company 589 * @param name the resource's name, which can be either a class name or a 590 portlet ID 591 * @param scope the scope 592 * @param primKey the primary key 593 * @param roleId the primary key of the role 594 * @param actionId the action ID 595 * @return <code>true</code> if the role has permission to perform the 596 action on the resource; <code>false</code> otherwise 597 * @throws PortalException if a role with the primary key or a resource 598 action with the name and action ID could not be found 599 * @throws SystemException if a system exception occurred 600 */ 601 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 602 public boolean hasResourcePermission(long companyId, java.lang.String name, 603 int scope, java.lang.String primKey, long roleId, 604 java.lang.String actionId) 605 throws com.liferay.portal.kernel.exception.PortalException, 606 com.liferay.portal.kernel.exception.SystemException; 607 608 /** 609 * Returns <code>true</code> if the roles have permission at the scope to 610 * perform the action on resources of the type. 611 * 612 * <p> 613 * Depending on the scope, the value of <code>primKey</code> will have 614 * different meanings. For more information, see {@link 615 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 616 * </p> 617 * 618 * @param companyId the primary key of the company 619 * @param name the resource's name, which can be either a class name or a 620 portlet ID 621 * @param scope the scope 622 * @param primKey the primary key 623 * @param roleIds the primary keys of the roles 624 * @param actionId the action ID 625 * @return <code>true</code> if any one of the roles has permission to 626 perform the action on the resource; <code>false</code> otherwise 627 * @throws PortalException if any one of the roles with the primary keys 628 could not be found or if a resource action with the name and 629 action ID could not be found 630 * @throws SystemException if a system exception occurred 631 */ 632 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 633 public boolean hasResourcePermission(long companyId, java.lang.String name, 634 int scope, java.lang.String primKey, long[] roleIds, 635 java.lang.String actionId) 636 throws com.liferay.portal.kernel.exception.PortalException, 637 com.liferay.portal.kernel.exception.SystemException; 638 639 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 640 public boolean[] hasResourcePermissions(long companyId, 641 java.lang.String name, int scope, java.lang.String primKey, 642 long[] roleIds, java.lang.String actionId) 643 throws com.liferay.portal.kernel.exception.PortalException, 644 com.liferay.portal.kernel.exception.SystemException; 645 646 /** 647 * Returns <code>true</code> if the role has permission at the scope to 648 * perform the action on the resource. 649 * 650 * <p> 651 * Depending on the scope, the value of <code>primKey</code> will have 652 * different meanings. For more information, see {@link 653 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 654 * </p> 655 * 656 * @param companyId the primary key of the company 657 * @param name the resource's name, which can be either a class name or a 658 portlet ID 659 * @param scope the scope 660 * @param roleId the primary key of the role 661 * @param actionId the action ID 662 * @return <code>true</code> if the role has permission to perform the 663 action on the resource; <code>false</code> otherwise 664 * @throws PortalException if a role with the primary key or a resource 665 action with the name and action ID could not be found 666 * @throws SystemException if a system exception occurred 667 */ 668 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 669 public boolean hasScopeResourcePermission(long companyId, 670 java.lang.String name, int scope, long roleId, java.lang.String actionId) 671 throws com.liferay.portal.kernel.exception.PortalException, 672 com.liferay.portal.kernel.exception.SystemException; 673 674 /** 675 * Reassigns all the resource permissions from the source role to the 676 * destination role, and deletes the source role. 677 * 678 * @param fromRoleId the primary key of the source role 679 * @param toRoleId the primary key of the destination role 680 * @throws PortalException if a role with the primary key could not be found 681 * @throws SystemException if a system exception occurred 682 */ 683 public void mergePermissions(long fromRoleId, long toRoleId) 684 throws com.liferay.portal.kernel.exception.PortalException, 685 com.liferay.portal.kernel.exception.SystemException; 686 687 /** 688 * Grants the role default permissions to all the resources of the type and 689 * at the scope stored in the resource permission, deletes the resource 690 * permission, and deletes the resource permission's role if it has no 691 * permissions remaining. 692 * 693 * @param resourcePermissionId the primary key of the resource permission 694 * @param toRoleId the primary key of the role 695 * @throws PortalException if a resource permission or role with the primary 696 key could not be found 697 * @throws SystemException if a system exception occurred 698 */ 699 public void reassignPermissions(long resourcePermissionId, long toRoleId) 700 throws com.liferay.portal.kernel.exception.PortalException, 701 com.liferay.portal.kernel.exception.SystemException; 702 703 /** 704 * Revokes permission at the scope from the role to perform the action on 705 * resources of the type. For example, this method could be used to revoke a 706 * group scope permission to edit blog posts. 707 * 708 * <p> 709 * Depending on the scope, the value of <code>primKey</code> will have 710 * different meanings. For more information, see {@link 711 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 712 * </p> 713 * 714 * @param companyId the primary key of the company 715 * @param name the resource's name, which can be either a class name or a 716 portlet ID 717 * @param scope the scope 718 * @param primKey the primary key 719 * @param roleId the primary key of the role 720 * @param actionId the action ID 721 * @throws PortalException if a role with the primary key or a resource 722 action with the name and action ID could not be found 723 * @throws SystemException if a system exception occurred 724 */ 725 public void removeResourcePermission(long companyId, java.lang.String name, 726 int scope, java.lang.String primKey, long roleId, 727 java.lang.String actionId) 728 throws com.liferay.portal.kernel.exception.PortalException, 729 com.liferay.portal.kernel.exception.SystemException; 730 731 /** 732 * Revokes all permissions at the scope from the role to perform the action 733 * on resources of the type. For example, this method could be used to 734 * revoke all individual scope permissions to edit blog posts from site 735 * members. 736 * 737 * @param companyId the primary key of the company 738 * @param name the resource's name, which can be either a class name or a 739 portlet ID 740 * @param scope the scope 741 * @param roleId the primary key of the role 742 * @param actionId the action ID 743 * @throws PortalException if a role with the primary key or a resource 744 action with the name and action ID could not be found 745 * @throws SystemException if a system exception occurred 746 */ 747 public void removeResourcePermissions(long companyId, 748 java.lang.String name, int scope, long roleId, java.lang.String actionId) 749 throws com.liferay.portal.kernel.exception.PortalException, 750 com.liferay.portal.kernel.exception.SystemException; 751 752 /** 753 * Updates the role's permissions at the scope, setting the actions that can 754 * be performed on resources of the type, also setting the owner of any 755 * newly created resource permissions. Existing actions are replaced. 756 * 757 * <p> 758 * This method can be used to set permissions at any scope, but it is 759 * generally only used at the individual scope. For example, it could be 760 * used to set the guest permissions on a blog post. 761 * </p> 762 * 763 * <p> 764 * Depending on the scope, the value of <code>primKey</code> will have 765 * different meanings. For more information, see {@link 766 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 767 * </p> 768 * 769 * @param companyId the primary key of the company 770 * @param name the resource's name, which can be either a class name or a 771 portlet ID 772 * @param scope the scope 773 * @param primKey the primary key 774 * @param roleId the primary key of the role 775 * @param ownerId the primary key of the owner (generally the user that 776 created the resource) 777 * @param actionIds the action IDs of the actions 778 * @throws PortalException if a role with the primary key or a resource 779 action with the name and action ID could not be found 780 * @throws SystemException if a system exception occurred 781 */ 782 public void setOwnerResourcePermissions(long companyId, 783 java.lang.String name, int scope, java.lang.String primKey, 784 long roleId, long ownerId, java.lang.String[] actionIds) 785 throws com.liferay.portal.kernel.exception.PortalException, 786 com.liferay.portal.kernel.exception.SystemException; 787 788 /** 789 * Updates the role's permissions at the scope, setting the actions that can 790 * be performed on resources of the type. Existing actions are replaced. 791 * 792 * <p> 793 * This method can be used to set permissions at any scope, but it is 794 * generally only used at the individual scope. For example, it could be 795 * used to set the guest permissions on a blog post. 796 * </p> 797 * 798 * <p> 799 * Depending on the scope, the value of <code>primKey</code> will have 800 * different meanings. For more information, see {@link 801 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 802 * </p> 803 * 804 * @param companyId the primary key of the company 805 * @param name the resource's name, which can be either a class name or a 806 portlet ID 807 * @param scope the scope 808 * @param primKey the primary key 809 * @param roleId the primary key of the role 810 * @param actionIds the action IDs of the actions 811 * @throws PortalException if a role with the primary key or a resource 812 action with the name and action ID could not be found 813 * @throws SystemException if a system exception occurred 814 */ 815 public void setResourcePermissions(long companyId, java.lang.String name, 816 int scope, java.lang.String primKey, long roleId, 817 java.lang.String[] actionIds) 818 throws com.liferay.portal.kernel.exception.PortalException, 819 com.liferay.portal.kernel.exception.SystemException; 820 821 /** 822 * Updates the role's permissions at the scope, setting the actions that can 823 * be performed on resources of the type. Existing actions are replaced. 824 * 825 * <p> 826 * This method can be used to set permissions at any scope, but it is 827 * generally only used at the individual scope. For example, it could be 828 * used to set the guest permissions on a blog post. 829 * </p> 830 * 831 * <p> 832 * Depending on the scope, the value of <code>primKey</code> will have 833 * different meanings. For more information, see {@link 834 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 835 * </p> 836 * 837 * @param companyId the primary key of the company 838 * @param name the resource's name, which can be either a class name or a 839 portlet ID 840 * @param scope the scope 841 * @param primKey the primary key 842 * @param roleIdsToActionIds a map of role IDs to action IDs of the actions 843 * @throws PortalException if a role with the primary key or a resource 844 action with the name and action ID could not be found 845 * @throws SystemException if a system exception occurred 846 */ 847 public void setResourcePermissions(long companyId, java.lang.String name, 848 int scope, java.lang.String primKey, 849 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds) 850 throws com.liferay.portal.kernel.exception.PortalException, 851 com.liferay.portal.kernel.exception.SystemException; 852 }