1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.permission;
16  
17  import com.liferay.portal.kernel.exception.PortalException;
18  import com.liferay.portal.kernel.exception.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  }