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.security.permission;
016    
017    import com.liferay.portal.model.User;
018    
019    import javax.portlet.PortletRequest;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public interface PermissionChecker {
025    
026            public static final long[] DEFAULT_ROLE_IDS = new long[] {0};
027    
028            public long getCompanyId();
029    
030            public long getOwnerRoleId();
031    
032            public long[] getRoleIds(long userId, long groupId);
033    
034            public long getUserId();
035    
036            public boolean hasOwnerPermission(
037                    long companyId, String name, long primKey, long ownerId,
038                    String actionId);
039    
040            public boolean hasOwnerPermission(
041                    long companyId, String name, String primKey, long ownerId,
042                    String actionId);
043    
044            public boolean hasPermission(
045                    long groupId, String name, long primKey, String actionId);
046    
047            public boolean hasPermission(
048                    long groupId, String name, String primKey, String actionId);
049    
050            public boolean hasUserPermission(
051                    long groupId, String name, String primKey, String actionId,
052                    boolean checkAdmin);
053    
054            public void init(User user, boolean checkGuest);
055    
056            public boolean isCommunityAdmin(long groupId);
057    
058            public boolean isCommunityOwner(long groupId);
059    
060            public boolean isCompanyAdmin();
061    
062            public boolean isCompanyAdmin(long companyId);
063    
064            public boolean isOmniadmin();
065    
066            public void resetValues();
067    
068            public void setCheckGuest(boolean checkGuest);
069    
070            public void setValues(PortletRequest portletRequest);
071    
072    }