001    /**
002     * Copyright (c) 2000-present 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.portal.security.permission;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.model.Group;
021    import com.liferay.portal.model.Organization;
022    import com.liferay.portal.model.Role;
023    
024    import java.io.Serializable;
025    
026    import java.util.Collection;
027    
028    /**
029     * @author L??szl?? Csontos
030     * @author Preston Crary
031     */
032    @ProviderType
033    public interface UserBag extends Serializable {
034    
035            public Collection<Group> getGroups() throws PortalException;
036    
037            public long[] getRoleIds();
038    
039            public Collection<Role> getRoles() throws PortalException;
040    
041            public long[] getUserGroupIds();
042    
043            public Collection<Group> getUserGroups() throws PortalException;
044    
045            public long getUserId();
046    
047            public long[] getUserOrgGroupIds();
048    
049            public Collection<Group> getUserOrgGroups() throws PortalException;
050    
051            public long[] getUserOrgIds();
052    
053            public Collection<Organization> getUserOrgs() throws PortalException;
054    
055            public boolean hasRole(Role role);
056    
057            public boolean hasUserGroup(Group group);
058    
059            public boolean hasUserOrg(Organization organization);
060    
061            public boolean hasUserOrgGroup(Group group);
062    
063    }