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.Account;
20  import com.liferay.portal.security.permission.PermissionChecker;
21  
22  /**
23   * <a href="AccountPermissionUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class AccountPermissionUtil {
28  
29      public static void check(
30              PermissionChecker permissionChecker, long accountId,
31              String actionId)
32          throws PortalException, SystemException {
33  
34          getAccountPermission().check(permissionChecker, accountId, actionId);
35      }
36  
37      public static void check(
38              PermissionChecker permissionChecker, Account account,
39              String actionId)
40          throws PortalException, SystemException {
41  
42          getAccountPermission().check(permissionChecker, account, actionId);
43      }
44  
45      public static boolean contains(
46              PermissionChecker permissionChecker, long accountId,
47              String actionId)
48          throws PortalException, SystemException {
49  
50          return getAccountPermission().contains(
51              permissionChecker, accountId, actionId);
52      }
53  
54      public static boolean contains(
55              PermissionChecker permissionChecker, Account account,
56              String actionId)
57          throws PortalException, SystemException {
58  
59          return getAccountPermission().contains(
60              permissionChecker, account, actionId);
61      }
62  
63      public static AccountPermission getAccountPermission() {
64          return _accountPermission;
65      }
66  
67      public void setAccountPermission(AccountPermission accountPermission) {
68          _accountPermission = accountPermission;
69      }
70  
71      private static AccountPermission _accountPermission;
72  
73  }