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