001    /**
002     * Copyright (c) 2000-2013 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.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.kernel.security.pacl.permission.PortalRuntimePermission;
020    import com.liferay.portal.security.permission.PermissionChecker;
021    import com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance;
022    
023    /**
024     * @author Michael C. Han
025     */
026    public class MDRRuleGroupInstancePermissionUtil {
027    
028            public static void check(
029                            PermissionChecker permissionChecker, long ruleGroupInstanceId,
030                            String actionId)
031                    throws PortalException, SystemException {
032    
033                    getMDRRuleGroupInstancePermission().check(
034                            permissionChecker, ruleGroupInstanceId, actionId);
035            }
036    
037            public static void check(
038                            PermissionChecker permissionChecker,
039                            MDRRuleGroupInstance ruleGroupInstance, String actionId)
040                    throws PortalException {
041    
042                    getMDRRuleGroupInstancePermission().check(
043                            permissionChecker, ruleGroupInstance, actionId);
044            }
045    
046            public static boolean contains(
047                            PermissionChecker permissionChecker, long ruleGroupInstanceId,
048                            String actionId)
049                    throws PortalException, SystemException {
050    
051                    return getMDRRuleGroupInstancePermission().contains(
052                            permissionChecker, ruleGroupInstanceId, actionId);
053            }
054    
055            public static boolean contains(
056                    PermissionChecker permissionChecker,
057                    MDRRuleGroupInstance ruleGroupInstance, String actionId) {
058    
059                    return getMDRRuleGroupInstancePermission().contains(
060                            permissionChecker, ruleGroupInstance, actionId);
061            }
062    
063            public static MDRRuleGroupInstancePermission
064                    getMDRRuleGroupInstancePermission() {
065    
066                    return _mdrRuleGroupInstancePermission;
067            }
068    
069            public void setMDRRuleGroupInstancePermission(
070                    MDRRuleGroupInstancePermission mdrRuleGroupInstancePermission) {
071    
072                    PortalRuntimePermission.checkSetBeanProperty(getClass());
073    
074                    _mdrRuleGroupInstancePermission = mdrRuleGroupInstancePermission;
075            }
076    
077            private static MDRRuleGroupInstancePermission
078                    _mdrRuleGroupInstancePermission;
079    
080    }