public class PollenUserSecurityContext extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
PollenUserSecurityContext.PollenUserSecurityRole
To define a security role for a given pollen user which can be
identified by his user account or a accountId.
|
Modifier and Type | Field and Description |
---|---|
protected Poll |
poll
Current loaded poll according to the
pollUri . |
protected PollUri |
pollUri
Poll uri defining the poll - pollAccount to use.
|
protected UserAccount |
userAccount
Connected user account.
|
protected Set<PollenUserSecurityContext.PollenUserSecurityRole> |
userRoles
User roles on the poll.
|
Modifier | Constructor and Description |
---|---|
protected |
PollenUserSecurityContext(UserAccount userAccount,
PollUri pollUri) |
Modifier and Type | Method and Description |
---|---|
String |
getAccountId() |
Poll |
getPoll() |
PollUri |
getPollUri() |
UserAccount |
getUserAccount() |
Set<PollenUserSecurityContext.PollenUserSecurityRole> |
getUserRoles() |
boolean |
hasNoRole() |
boolean |
isAdmin() |
boolean |
isConnected() |
boolean |
isCreator() |
boolean |
isPollExists() |
boolean |
isRestrictedVoter() |
boolean |
isVoter() |
boolean |
isWithAccountId() |
void |
loadUserRoles(SecurityService securityService) |
static PollenUserSecurityContext |
newContext(UserAccount userAccount,
PollUri pollUri) |
static PollenUserSecurityContext |
newContext(UserAccount userAccount,
PollUri pollUri,
Poll poll) |
static PollenUserSecurityContext |
newContext(UserAccount userAccount,
String pollId,
String accountId,
Poll poll) |
void |
removeAccountIdWhenConnected(PollUrl url) |
void |
setPoll(Poll poll) |
protected final UserAccount userAccount
null
if user is not connected.protected final PollUri pollUri
PollUri
protected Poll poll
pollUri
.
Note: this poll should be used by any action needed it.protected Set<PollenUserSecurityContext.PollenUserSecurityRole> userRoles
loadUserRoles(SecurityService)
.protected PollenUserSecurityContext(UserAccount userAccount, PollUri pollUri)
public static PollenUserSecurityContext newContext(UserAccount userAccount, PollUri pollUri)
public static PollenUserSecurityContext newContext(UserAccount userAccount, String pollId, String accountId, Poll poll)
public static PollenUserSecurityContext newContext(UserAccount userAccount, PollUri pollUri, Poll poll)
public boolean isPollExists()
public boolean isAdmin()
public boolean isWithAccountId()
public boolean isCreator()
public boolean isVoter()
public boolean isRestrictedVoter()
public boolean hasNoRole()
public Set<PollenUserSecurityContext.PollenUserSecurityRole> getUserRoles()
public UserAccount getUserAccount()
public PollUri getPollUri()
public Poll getPoll()
public void setPoll(Poll poll)
public void loadUserRoles(SecurityService securityService)
public String getAccountId()
public void removeAccountIdWhenConnected(PollUrl url)
public boolean isConnected()
Copyright © 2009–2014 CodeLutin. All rights reserved.