001    /**
002     * Copyright (c) 2000-2010 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.portal.service.permission;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.model.Team;
020    import com.liferay.portal.security.permission.PermissionChecker;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public class TeamPermissionUtil {
026    
027            public static void check(
028                            PermissionChecker permissionChecker, long teamId, String actionId)
029                    throws PortalException, SystemException {
030    
031                    getTeamPermission().check(permissionChecker, teamId, actionId);
032            }
033    
034            public static void check(
035                            PermissionChecker permissionChecker, Team team, String actionId)
036                    throws PortalException, SystemException {
037    
038                    getTeamPermission().check(permissionChecker, team, actionId);
039            }
040    
041            public static boolean contains(
042                            PermissionChecker permissionChecker, long teamId, String actionId)
043                    throws PortalException, SystemException {
044    
045                    return getTeamPermission().contains(
046                            permissionChecker, teamId, actionId);
047            }
048    
049            public static boolean contains(
050                            PermissionChecker permissionChecker, Team team, String actionId)
051                    throws PortalException, SystemException {
052    
053                    return getTeamPermission().contains(permissionChecker, team, actionId);
054            }
055    
056            public static TeamPermission getTeamPermission() {
057                    return _userGroupPermission;
058            }
059    
060            public void setTeamPermission(
061                    TeamPermission userGroupPermission) {
062    
063                    _userGroupPermission = userGroupPermission;
064            }
065    
066            private static TeamPermission _userGroupPermission;
067    
068    }