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.portlet.expando.service.permission;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.security.permission.PermissionChecker;
020    import com.liferay.portlet.expando.model.ExpandoColumn;
021    
022    /**
023     * @author Michael C. Han
024     */
025    public class ExpandoColumnPermissionUtil {
026    
027            public static void check(
028                            PermissionChecker permissionChecker, ExpandoColumn column,
029                            String actionId)
030                    throws PortalException {
031    
032                    getExpandoColumnPermission().check(permissionChecker, column, actionId);
033            }
034    
035            public static void check(
036                            PermissionChecker permissionChecker, long columnId, String actionId)
037                    throws PortalException, SystemException {
038    
039                    getExpandoColumnPermission().check(
040                            permissionChecker, columnId, actionId);
041            }
042    
043            public static void check(
044                            PermissionChecker permissionChecker, long companyId,
045                            String className, String tableName, String columnName,
046                            String actionId)
047                    throws PortalException, SystemException {
048    
049                    getExpandoColumnPermission().check(
050                            permissionChecker, companyId, className, tableName,
051                            columnName, actionId);
052            }
053    
054            public static boolean contains(
055                    PermissionChecker permissionChecker, ExpandoColumn column,
056                    String actionId) {
057    
058                    return getExpandoColumnPermission().contains(
059                            permissionChecker, column, actionId);
060            }
061    
062            public static boolean contains(
063                            PermissionChecker permissionChecker, long columnId, String actionId)
064                    throws PortalException, SystemException {
065    
066                    return getExpandoColumnPermission().contains(
067                            permissionChecker, columnId, actionId);
068            }
069    
070            public static boolean contains(
071                            PermissionChecker permissionChecker, long companyId,
072                            String className, String tableName, String columnName,
073                            String actionId)
074                    throws SystemException {
075    
076                    return getExpandoColumnPermission().contains(
077                            permissionChecker, companyId, className, tableName,
078                            columnName, actionId);
079            }
080    
081            public static ExpandoColumnPermission getExpandoColumnPermission() {
082                    return _expandoColumnPermission;
083            }
084    
085            public void setExpandoColumnPermission(
086                    ExpandoColumnPermission expandoColumnPermission) {
087    
088                    _expandoColumnPermission = expandoColumnPermission;
089            }
090    
091            private static ExpandoColumnPermission _expandoColumnPermission;
092    
093    }