org.persvr.security
Class CapabilityUser
java.lang.Object
NativeObject
org.persvr.data.PersistableObject
org.persvr.security.CapabilityObject
org.persvr.security.CapabilityUser
- All Implemented Interfaces:
- java.security.acl.Permission, java.security.Principal, ObservablePersistable, Persistable, Capability, User
public class CapabilityUser
- extends CapabilityObject
- implements User
There are three states of a user:
1. anonymous private - user is maintained across sessions through cookies and can be converted to a real user by establishing a username and password. This is the default state.
2. shared public - multiple users are using this computer so a user is not maintained across sessions
3. authenticated - either one or two can convert to this, but if a user already exists, it must do a merge of data
| Methods inherited from class org.persvr.data.PersistableObject |
addListener, checkPut, checkSecurity, commitPut, computeAccessLevel, convertToDateJavaDate, delete, delete, enableSecurity, entrySet, get, get, get, get, getAccessLevel, getCoreValue, getHistory, getId, getIds, getLastModified, getParent, getPermissionObject, getReadSet, getSchema, getWatchSet, initArray, initializeProperty, initObject, isSecurityEnabled, keySet, noCheckGet, put, recordObjectRead, removeListener, resetComputedPermissions, startReadSet, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.security.acl.Permission |
equals, toString |
| Methods inherited from interface java.security.Principal |
equals, hashCode, toString |
PUBLIC_USER_NAME
public static final java.lang.String PUBLIC_USER_NAME
- See Also:
- Constant Field Values
computedPermissions
public java.util.Map<Persistable,PermissionLevel> computedPermissions
PUBLIC_USER
public static CapabilityUser PUBLIC_USER
PRIVILEDGED_USER_OBJECT
public static final Persistable PRIVILEDGED_USER_OBJECT
EVERYONE
public static final java.lang.String EVERYONE
- See Also:
- Constant Field Values
SUPER_ROLE
public static final java.lang.Object SUPER_ROLE
USERS_HAVE_SEPARATE_SPACE_WITHIN_WEBSITES
public static final boolean USERS_HAVE_SEPARATE_SPACE_WITHIN_WEBSITES
- See Also:
- Constant Field Values
threadWebsiteMap
public static java.util.Map<java.lang.Thread,java.lang.String> threadWebsiteMap
CapabilityUser
public CapabilityUser()
getPermissionLevel
public int getPermissionLevel(Persistable obj)
- Description copied from interface:
Capability
- Determines whether this capability can access the given object
- Specified by:
getPermissionLevel in interface Capability- Overrides:
getPermissionLevel in class CapabilityObject
- Returns:
resetSecurity
public static void resetSecurity()
onCreation
public void onCreation()
- Description copied from interface:
Persistable
- Called when an persistent object is first created (not when the Java object is created to restore state)
- Specified by:
onCreation in interface Persistable- Overrides:
onCreation in class CapabilityObject
getSupervisorGroup
public static java.security.acl.Group getSupervisorGroup()
publicUser
@Deprecated
public static CapabilityUser publicUser()
- Deprecated.
getCurrentTicket
public java.lang.String getCurrentTicket()
- Description copied from interface:
User
- Allows a user to return ticket so that the password does not need to be stored for reauthentication
This may be moved to a separate interface
- Specified by:
getCurrentTicket in interface User
- Returns:
- ticket
getUserByTicket
public static CapabilityUser getUserByTicket(java.lang.String id,
java.lang.String ipAddress)
throws javax.security.auth.login.LoginException
- Throws:
javax.security.auth.login.LoginException
getNewTicket
@Deprecated
public java.lang.String getNewTicket(java.lang.String ipAddress)
- Deprecated.
getUserByUsername
public static CapabilityUser getUserByUsername(java.lang.String username)
authenticate
public static CapabilityUser authenticate(java.lang.String username,
java.lang.String password)
throws javax.security.auth.login.LoginException
- Throws:
javax.security.auth.login.LoginException
usersTable
protected static PersistableList usersTable()
logout
public void logout()
getName
public java.lang.String getName()
- Specified by:
getName in interface java.security.Principal
getPassword
public java.lang.String getPassword()
setUsername
public void setUsername(java.lang.String username)
su
public CapabilityUser su(java.lang.String username)
setPassword
public void setPassword(java.lang.String password)
calculateMembership
public static java.util.Set<Persistable> calculateMembership(Persistable member,
java.util.List groupToConsider)
compareTo
public int compareTo(java.lang.Object o)
getUserData
public PersistableObject getUserData()
registerThisWebsite
public static void registerThisWebsite(java.lang.String webappContextName)
- This registers which website we are using for this particular user, which affects the users data and possibly the user table that is used
getCurrentWebsiteName
public static java.lang.String getCurrentWebsiteName()
getWebsite
public static Persistable getWebsite()
getWebsiteSourceObject
public static Persistable getWebsiteSourceObject()
getWebsites
public static Persistable getWebsites()
getCurrentEditingVersion
public PersistableObject getCurrentEditingVersion()
isHostSpecificSecurity
public static boolean isHostSpecificSecurity()
setHostSpecificSecurity
public static void setHostSpecificSecurity(boolean websiteSpecificSecurity)
setupSecurity
public static void setupSecurity()