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