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.Layout;
20  import com.liferay.portal.security.permission.PermissionChecker;
21  
22  /**
23   * <a href="LayoutPermissionUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class LayoutPermissionUtil {
28  
29      public static void check(
30              PermissionChecker permissionChecker, long plid, String actionId)
31          throws PortalException, SystemException {
32  
33          getLayoutPermission().check(permissionChecker, plid, actionId);
34      }
35  
36      public static void check(
37              PermissionChecker permissionChecker, long groupId,
38              boolean privateLayout, long layoutId, String actionId)
39          throws PortalException, SystemException {
40  
41          getLayoutPermission().check(
42              permissionChecker, groupId, privateLayout, layoutId, actionId);
43      }
44  
45      public static void check(
46              PermissionChecker permissionChecker, Layout layout, String actionId)
47          throws PortalException, SystemException {
48  
49          getLayoutPermission().check(permissionChecker, layout, actionId);
50      }
51  
52      public static boolean contains(
53              PermissionChecker permissionChecker, long plid, String actionId)
54          throws PortalException, SystemException {
55  
56          return getLayoutPermission().contains(
57              permissionChecker, plid, actionId);
58      }
59  
60      public static boolean contains(
61              PermissionChecker permissionChecker, long groupId,
62              boolean privateLayout, long layoutId, String actionId)
63          throws PortalException, SystemException {
64  
65          return getLayoutPermission().contains(
66              permissionChecker, groupId, privateLayout, layoutId, actionId);
67      }
68  
69      public static boolean contains(
70              PermissionChecker permissionChecker, Layout layout, String actionId)
71          throws PortalException, SystemException {
72  
73          return getLayoutPermission().contains(
74              permissionChecker, layout, actionId);
75      }
76  
77      public static LayoutPermission getLayoutPermission() {
78          return _layoutPermission;
79      }
80  
81      public void setLayoutPermission(LayoutPermission layoutPermission) {
82          _layoutPermission = layoutPermission;
83      }
84  
85      private static LayoutPermission _layoutPermission;
86  
87  }