public class PrincipalManager extends Object implements IPrincipalManagerSPI
Modifier and Type | Field and Description |
---|---|
protected static int |
ACCESS_ADMINISTRATOR |
protected static int |
ACCESS_OWNER |
Constructor and Description |
---|
PrincipalManager() |
Modifier and Type | Method and Description |
---|---|
void |
add(SessionConfig sessionConfig,
PrincipalConfig principal,
ITransaction transaction)
Add a Principal.
|
protected Collection<CacheItem<PrincipalConfig>> |
bulkLoadPrincipals(ICacheMultiDataProvider.IRequest request)
Read all principals given the cache request.
|
void |
delete(SessionConfig sessionConfig,
String principalId,
ITransaction transaction)
Remove a Principal.
|
PrincipalConfig |
get(SessionConfig sessionConfig,
String principalId,
ITransaction transaction)
Get the Principal.
|
PrincipalConfig |
getByShortId(SessionConfig sessionConfig,
String shortId,
ITransaction transaction)
Get the Principal given the shortId.
|
Set<String> |
getPortalUserMembers(SessionConfig sessionConfig,
String principalId,
ITransaction transaction)
Returns the members that are (portal) users of the given principal.
The return value will be: If the given principal is a user: a set with a single entry that is the given user itself. If the given principal is a user segmentation: a set with the users that are members of the given segmentation. If the given principal is a group: a set containing the result of a recursion in this method with each direct member of the given group. |
Principals |
getPrincipalPrincipals(SessionConfig sessionConfig,
String principalId,
boolean useSessionCache,
ITransaction transaction)
Returns the principals of the given principal.
The return value will be: If the given principal is a user: a set with an entry that is the given user itself and the result of the recursion in this method for each group and segmentation the user is member of. |
Set<String> |
getPrincipals(SessionConfig sessionConfig,
String principalId,
ITransaction transaction)
Returns the principals of the given principal.
The return value will be: If the given principal is a user: a set with an entry that is the given user itself and the result of the recursion in this method for each group and segmentation the user is member of. |
boolean |
isMember(SessionConfig sessionConfig,
String portalUserId,
Collection<String> principalIds,
ITransaction transaction)
Check whether the principal is a member of any given principal.
|
boolean |
keyExists(SessionConfig sessionConfig,
Object configKey,
Object config,
ITransaction transaction)
Checks if configId matches an already persisted object
|
void |
update(SessionConfig sessionConfig,
PrincipalConfig principal,
ITransaction transaction)
Update a Principal.
|
protected int |
validateAccess(SessionConfig sessionConfig,
PrincipalConfig principal,
ITransaction transaction) |
protected void |
validateAdministrationAccess(SessionConfig sessionConfig,
PrincipalConfig principal,
ITransaction transaction) |
protected static final int ACCESS_OWNER
protected static final int ACCESS_ADMINISTRATOR
protected Collection<CacheItem<PrincipalConfig>> bulkLoadPrincipals(ICacheMultiDataProvider.IRequest request) throws PortalException, DaoException
request
- the request.PortalException
DaoException
public void add(SessionConfig sessionConfig, PrincipalConfig principal, ITransaction transaction) throws PortalException
IPrincipalManager
add
in interface IPrincipalManager
PortalException
public void update(SessionConfig sessionConfig, PrincipalConfig principal, ITransaction transaction) throws PortalException
IPrincipalManager
update
in interface IPrincipalManager
PortalException
public void delete(SessionConfig sessionConfig, String principalId, ITransaction transaction) throws PortalException
IPrincipalManager
delete
in interface IPrincipalManager
PortalException
public PrincipalConfig get(SessionConfig sessionConfig, String principalId, ITransaction transaction) throws PortalException
IPrincipalManager
get
in interface IPrincipalManager
PortalException
public PrincipalConfig getByShortId(SessionConfig sessionConfig, String shortId, ITransaction transaction) throws PortalException
IPrincipalManager
getByShortId
in interface IPrincipalManager
PortalException
protected void validateAdministrationAccess(SessionConfig sessionConfig, PrincipalConfig principal, ITransaction transaction) throws PortalException
PortalException
protected int validateAccess(SessionConfig sessionConfig, PrincipalConfig principal, ITransaction transaction) throws PortalException
PortalException
public boolean keyExists(SessionConfig sessionConfig, Object configKey, Object config, ITransaction transaction)
IConfigKeyChecker
keyExists
in interface IConfigKeyChecker
config
- Optional, allows a checker to read aditional fields to check composed keyspublic Set<String> getPortalUserMembers(SessionConfig sessionConfig, String principalId, ITransaction transaction) throws PortalException
IPrincipalManager
getPortalUserMembers
in interface IPrincipalManager
sessionConfig
- the user's session.principalId
- the principal identifier.transaction
- the transaction.PortalException
public Set<String> getPrincipals(SessionConfig sessionConfig, String principalId, ITransaction transaction) throws PortalException
IPrincipalManager
getPrincipals
in interface IPrincipalManager
sessionConfig
- the user's session.principalId
- the principal identifier.transaction
- the transaction.PortalException
public boolean isMember(SessionConfig sessionConfig, String portalUserId, Collection<String> principalIds, ITransaction transaction) throws PortalException
IPrincipalManager
isMember
in interface IPrincipalManager
sessionConfig
- the sesssion config.portalUserId
- the identifier of user.principalIds
- the identifiers of principals.transaction
- the transaction.PortalException
public Principals getPrincipalPrincipals(SessionConfig sessionConfig, String principalId, boolean useSessionCache, ITransaction transaction) throws PortalException
IPrincipalManagerSPI
getPrincipalPrincipals
in interface IPrincipalManagerSPI
sessionConfig
- the user's session.principalId
- the principal identifier.useSessionCache
- indicates whether the session cache should be used.transaction
- the transaction.PortalException
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.