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.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 extends Cloneable {
025    
026            public static final long[] DEFAULT_ROLE_IDS = {};
027    
028            public PermissionChecker clone();
029    
030            public long getCompanyId();
031    
032            public long getOwnerRoleId();
033    
034            public long[] getRoleIds(long userId, long groupId);
035    
036            public long getUserId();
037    
038            public boolean hasOwnerPermission(
039                    long companyId, String name, long primKey, long ownerId,
040                    String actionId);
041    
042            public boolean hasOwnerPermission(
043                    long companyId, String name, String primKey, long ownerId,
044                    String actionId);
045    
046            public boolean hasPermission(
047                    long groupId, String name, long primKey, String actionId);
048    
049            public boolean hasPermission(
050                    long groupId, String name, String primKey, String actionId);
051    
052            public boolean hasUserPermission(
053                    long groupId, String name, String primKey, String actionId,
054                    boolean checkAdmin);
055    
056            public void init(User user, boolean checkGuest);
057    
058            public boolean isCheckGuest();
059    
060            public boolean isCommunityAdmin(long groupId);
061    
062            public boolean isCommunityOwner(long groupId);
063    
064            public boolean isCompanyAdmin();
065    
066            public boolean isCompanyAdmin(long companyId);
067    
068            public boolean isOmniadmin();
069    
070            public boolean isSignedIn();
071    
072            /**
073             * @deprecated Does nothing
074             */
075            public void resetValues();
076    
077            public void setCheckGuest(boolean checkGuest);
078    
079            /**
080             * @deprecated Does nothing
081             */
082            public void setValues(PortletRequest portletRequest);
083    
084    }