001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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, columnName,
051                            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, columnName,
078                            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    }