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.mobiledevicerules.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.mobiledevicerules.model.MDRRuleGroup;
021    
022    /**
023     * @author Michael C. Han
024     */
025    public class MDRRuleGroupPermissionUtil {
026    
027            public static void check(
028                            PermissionChecker permissionChecker, long ruleGroupId,
029                            String actionId)
030                    throws PortalException, SystemException {
031    
032                    getMDRRuleGroupPermission().check(
033                            permissionChecker, ruleGroupId, actionId);
034            }
035    
036            public static void check(
037                            PermissionChecker permissionChecker, MDRRuleGroup ruleGroup,
038                            String actionId)
039                    throws PortalException {
040    
041                    getMDRRuleGroupPermission().check(
042                            permissionChecker, ruleGroup, actionId);
043            }
044    
045            public static boolean contains(
046                            PermissionChecker permissionChecker, long ruleGroupId,
047                            String actionId)
048                    throws PortalException, SystemException {
049    
050                    return getMDRRuleGroupPermission().contains(
051                            permissionChecker, ruleGroupId, actionId);
052            }
053    
054            public static boolean contains(
055                    PermissionChecker permissionChecker, MDRRuleGroup ruleGroup,
056                    String actionId) {
057    
058                    return getMDRRuleGroupPermission().contains(
059                            permissionChecker, ruleGroup, actionId);
060            }
061    
062            public static MDRRuleGroupPermission getMDRRuleGroupPermission() {
063                    return _mdrRuleGroupPermission;
064            }
065    
066            public void setMDRRuleGroupPermission(
067                    MDRRuleGroupPermission mdrRuleGroupPermission) {
068    
069                    _mdrRuleGroupPermission = mdrRuleGroupPermission;
070            }
071    
072            private static MDRRuleGroupPermission _mdrRuleGroupPermission;
073    
074    }