1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.permission;
16  
17  import com.liferay.portal.PortalException;
18  import com.liferay.portal.SystemException;
19  import com.liferay.portal.model.Organization;
20  import com.liferay.portal.security.permission.PermissionChecker;
21  
22  /**
23   * <a href="OrganizationPermissionUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class OrganizationPermissionUtil {
28  
29      public static void check(
30              PermissionChecker permissionChecker, long organizationId,
31              String actionId)
32          throws PortalException, SystemException {
33  
34          getOrganizationPermission().check(
35              permissionChecker, organizationId, actionId);
36      }
37  
38      public static void check(
39              PermissionChecker permissionChecker, Organization organization,
40              String actionId)
41          throws PortalException, SystemException {
42  
43          getOrganizationPermission().check(
44              permissionChecker, organization, actionId);
45      }
46  
47      public static boolean contains(
48              PermissionChecker permissionChecker, long organizationId,
49              String actionId)
50          throws PortalException, SystemException {
51  
52          return getOrganizationPermission().contains(
53              permissionChecker, organizationId, actionId);
54      }
55  
56      public static boolean contains(
57              PermissionChecker permissionChecker, Organization organization,
58              String actionId)
59          throws PortalException, SystemException {
60  
61          return getOrganizationPermission().contains(
62              permissionChecker, organization, actionId);
63      }
64  
65      public static OrganizationPermission getOrganizationPermission() {
66          return _organizationPermission;
67      }
68  
69      public void setOrganizationPermission(
70          OrganizationPermission organizationPermission) {
71  
72          _organizationPermission = organizationPermission;
73      }
74  
75      private static OrganizationPermission _organizationPermission;
76  
77  }