com.flexive.shared.security
Interface UserTicket

All Superinterfaces:
java.io.Serializable

public interface UserTicket
extends java.io.Serializable

The UserTicket caches informations about a user.

Version:
$Rev: 2906 $
Author:
Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Method Summary
 UserTicket cloneAsGlobalSupervisor()
          Clones a ticket with global supervisor permissions.
 UserTicket copy()
          Creates an independent copy of this ticket.
 ACLAssignment[] getACLAssignments()
          Returns all ACLAssignments for the user.
 ACLAssignment[] getACLAssignments(ACLCategory category, long ownerId, ACLPermission... perms)
          Returns all ACLAssignments for the user matching the filter parameters.
 ACL[] getACLs(long owner, ACLCategory category, ACLPermission... perms)
          Returns the id of all ACLs for the user matching the filter parameters.
 java.lang.String getACLsCSV(long ownerId, ACLCategory category, ACLPermission... perms)
          Returns the id of all ACLs for the user matching the filter parameters as comma separated list.
 java.lang.Long[] getACLsId(long ownerId, ACLCategory category, ACLPermission... perms)
          Returns the id of all ACLs for the user matching the filter parameters.
 java.lang.String getApplicationId()
          Returns the application id the ticket belongs to.
 AuthenticationSource getAuthenticationSource()
          Get the source used to authenticate the user
 FxPK getContactData()
          Get the primary key for the associated contact data
 long getCreationTime()
          Returns the time that this ticket was created at.
 java.lang.String getDateFormat()
          Get the user specific date format pattern
 java.lang.String getDateTimeFormat()
          Get the user specific date/time format pattern
 char getDecimalSeparator()
          Get the user specific decimal separator character to use
 long getFailedLoginAttempts()
          Get the number of failed login attempts until the user sucessfully logged in
 char getGroupingSeparator()
          Get the user specific grouping separator character to use
 long[] getGroups()
          Returns all groups the user is in.
 FxLanguage getLanguage()
          Get the default language of this user
 java.lang.String getLoginName()
          Returns the unique login name of the user.
 long getMandatorId()
          Returns the id of the mandator the user belongs to.
 java.lang.String getTimeFormat()
          Get the user specific time format pattern
 long getUserId()
          Getter for the user id
 java.lang.String getUserName()
          Getter for the (not unique) user name
 void initUserSpecificSettings()
          Initialize user specific settings like formatting options
 boolean isAssignedToACL(long aclId)
          Returns true if the user is assigned to a given ACL.
 boolean isGlobalSupervisor()
          Return true if the user is a global supervisor.
 boolean isGuest()
          Returns true if the ticket is a guest user.
 boolean isInAtLeastOneGroup(long[] groups)
          Returns true if the user is a member of at least one of the given groups.
 boolean isInGroup(long group)
          Returns true if the user is a member of the given group.
 boolean isInGroup(java.lang.String group)
          Returns true if the user is a member of the given group.
 boolean isInGroups(int[] groups)
          Returns true if the user is a member of all the given group.
 boolean isInRole(Role role)
          Returns true if the user is assigned to the given role.
 boolean isMandatorSupervisor()
          Return true if the user is a supervisor within its domain
 boolean isMultiLogin()
          Returns true if more than one session with the tickets user can be logged in at the same time.
 boolean isWebDav()
          Returns true if this is a ticket for the webdav part of the application.
 boolean mayCreateACL(long aclId, long ownerId)
          Returns true if the user may create objects using the given ACL.
 boolean mayDeleteACL(long aclId, long ownerId)
          Returns true if the user may edit objects using the given ACL.
 boolean mayEditACL(long aclId, long ownerId)
          Returns true if the user may edit objects using the given ACL.
 boolean mayExportACL(long aclId, long ownerId)
          Returns true if the user may export objects using the given ACL.
 boolean mayReadACL(long aclId, long ownerId)
          Returns true if the user may read objects using the given ACL.
 boolean mayRelateACL(long aclId, long ownerId)
          Returns true if the user may relate objects to a object using the given ACL.
 void setLanguage(FxLanguage language)
          Override the users language.
 boolean useGroupingSeparator()
          Use the grouping separator?
 

Method Detail

getUserName

java.lang.String getUserName()
Getter for the (not unique) user name

Returns:
the (not unique) user name

isGuest

boolean isGuest()
Returns true if the ticket is a guest user.

Returns:
true if the ticket is a guest user

getLoginName

java.lang.String getLoginName()
Returns the unique login name of the user.

Returns:
the unique login name of the user.

getUserId

long getUserId()
Getter for the user id

Returns:
the user id

getContactData

FxPK getContactData()
Get the primary key for the associated contact data

Returns:
primary key for the associated contact data

isMultiLogin

boolean isMultiLogin()
Returns true if more than one session with the tickets user can be logged in at the same time.

Returns:
true if more than one session with the tickets user can be logged in at the same time.

isGlobalSupervisor

boolean isGlobalSupervisor()
Return true if the user is a global supervisor.

Returns:
true if the user is a global supervisor

isMandatorSupervisor

boolean isMandatorSupervisor()
Return true if the user is a supervisor within its domain

Returns:
true if the user is a supervisor within its domain

getMandatorId

long getMandatorId()
Returns the id of the mandator the user belongs to.

Returns:
the id of the mandator the user belongs to

isInGroup

boolean isInGroup(long group)
Returns true if the user is a member of the given group.

Parameters:
group - the group id to check for
Returns:
true if the user is a member of the given group

isInGroup

boolean isInGroup(java.lang.String group)
Returns true if the user is a member of the given group.

Parameters:
group - the group name to check for
Returns:
true if the user is a member of the given group
Since:
3.1.4

isInRole

boolean isInRole(Role role)
Returns true if the user is assigned to the given role.

Parameters:
role - the role to check for
Returns:
true if the user is assigned to the given role

isInGroups

boolean isInGroups(int[] groups)
Returns true if the user is a member of all the given group.

Returns true if the groups parameter is null or empty

Parameters:
groups - the groups to check for
Returns:
true if the user is a member of all the given group

getGroups

long[] getGroups()
Returns all groups the user is in.

Every user is at least in the Group EVERYONE

Returns:
all groups the user is in.

isInAtLeastOneGroup

boolean isInAtLeastOneGroup(long[] groups)
Returns true if the user is a member of at least one of the given groups.

Returns true if the groups parameter is null or empty

Parameters:
groups - the groups to check for
Returns:
true if the user is a member of all the given group

getApplicationId

java.lang.String getApplicationId()
Returns the application id the ticket belongs to.

Returns:
the application id the ticket belongs to

getACLAssignments

ACLAssignment[] getACLAssignments()
Returns all ACLAssignments for the user.

The user inherits all ACLAssignments from his groups.

Returns:
all ACLAssignments for the user, may be a empty list but is never null

isAssignedToACL

boolean isAssignedToACL(long aclId)
Returns true if the user is assigned to a given ACL.

Parameters:
aclId - the acl to check for
Returns:
true if the user is assigned to the ACL, or false.

getCreationTime

long getCreationTime()
Returns the time that this ticket was created at.

Returns:
the time that the ticket was created at

mayReadACL

boolean mayReadACL(long aclId,
                   long ownerId)
Returns true if the user may read objects using the given ACL.

Parameters:
aclId - the acl
ownerId - id of the owner
Returns:
true if the user may read objects using the given ACL

mayEditACL

boolean mayEditACL(long aclId,
                   long ownerId)
Returns true if the user may edit objects using the given ACL.

Parameters:
aclId - the acl
ownerId - id of the owner
Returns:
true if the user may edit objects using the given ACL

mayExportACL

boolean mayExportACL(long aclId,
                     long ownerId)
Returns true if the user may export objects using the given ACL.

Parameters:
aclId - the acl
ownerId - id of the owner
Returns:
true if the user may export objects using the given ACL

mayRelateACL

boolean mayRelateACL(long aclId,
                     long ownerId)
Returns true if the user may relate objects to a object using the given ACL.

Parameters:
aclId - the acl
ownerId - id of the owner
Returns:
true if the user may relate objects using the given ACL

mayCreateACL

boolean mayCreateACL(long aclId,
                     long ownerId)
Returns true if the user may create objects using the given ACL.

Parameters:
aclId - the acl
ownerId - id of the owner
Returns:
true if the user may create objects using the given ACL

mayDeleteACL

boolean mayDeleteACL(long aclId,
                     long ownerId)
Returns true if the user may edit objects using the given ACL.

Parameters:
aclId - the acl
ownerId - id of the owner
Returns:
true if the user may edit objects using the given ACL

getACLAssignments

ACLAssignment[] getACLAssignments(ACLCategory category,
                                  long ownerId,
                                  ACLPermission... perms)
Returns all ACLAssignments for the user matching the filter parameters.

A ACL may accure multiple times within the result, since the ACLAssignment object contains the groupId that the ACL is assigned to. The user itself gets the ACLAssignments from the groups he belongs to.

Parameters:
category - all assignments if null, or only those matching the given category
ownerId - id of the owner
perms - ACL.PERM
Returns:
all ACLAssignments for the user matching the filter parameters, may be a empty array but is never null

getACLsId

java.lang.Long[] getACLsId(long ownerId,
                           ACLCategory category,
                           ACLPermission... perms)
Returns the id of all ACLs for the user matching the filter parameters.

The ACL ids are distinct within the result.
The permissions the user gets from all groups he belongs to are taken into account.

Parameters:
ownerId - id of the owner
category - ACL.CATEGORY
perms - ACL.PERM
Returns:
all ACL ids for the user matching the filter parameters, may be an empty array but is never null

getACLsCSV

java.lang.String getACLsCSV(long ownerId,
                            ACLCategory category,
                            ACLPermission... perms)
Returns the id of all ACLs for the user matching the filter parameters as comma separated list.

The ACL ids are distinct within the result.
The permissions the user gets from all groups he belongs to are taken into account.

Parameters:
ownerId - id of the owner
category - all assignments if null, or only those matching the given category
perms - ACL.PERM
Returns:
all ACL ids for the user matching the filter parameters as comma separated list.

getACLs

ACL[] getACLs(long owner,
              ACLCategory category,
              ACLPermission... perms)
Returns the id of all ACLs for the user matching the filter parameters.

The ACL ids are distinct within the result.
The permissions the user gets from all groups he belongs to are taken into account.

Parameters:
owner - id of the owner
category - ACL.CATEGORY
perms - ACL.PERM
Returns:
all ACL ids for the user matching the filter parameters, may be an empty array but is never null

getLanguage

FxLanguage getLanguage()
Get the default language of this user

Returns:
default language of this user

isWebDav

boolean isWebDav()
Returns true if this is a ticket for the webdav part of the application.

Returns:
true if this is a ticket for the webdav part of the application.

cloneAsGlobalSupervisor

UserTicket cloneAsGlobalSupervisor()
Clones a ticket with global supervisor permissions.

Returns:
the cloned ticket with the given session id

getFailedLoginAttempts

long getFailedLoginAttempts()
Get the number of failed login attempts until the user sucessfully logged in

Returns:
number of failed login attempts until the user sucessfully logged in

getAuthenticationSource

AuthenticationSource getAuthenticationSource()
Get the source used to authenticate the user

Returns:
source used to authenticate the user

setLanguage

void setLanguage(FxLanguage language)
Override the users language. Please note that overriding a language will only work for the current session. To change the language permantently edit the users account data!

Parameters:
language - language to override

getDateFormat

java.lang.String getDateFormat()
Get the user specific date format pattern

Returns:
user specific date format pattern

getTimeFormat

java.lang.String getTimeFormat()
Get the user specific time format pattern

Returns:
user specific time format pattern

getDateTimeFormat

java.lang.String getDateTimeFormat()
Get the user specific date/time format pattern

Returns:
user specific date/time format pattern

getDecimalSeparator

char getDecimalSeparator()
Get the user specific decimal separator character to use

Returns:
user specific decimal separator character to use

getGroupingSeparator

char getGroupingSeparator()
Get the user specific grouping separator character to use

Returns:
user specific grouping separator character to use

useGroupingSeparator

boolean useGroupingSeparator()
Use the grouping separator?

Returns:
use the grouping separator?

copy

UserTicket copy()
Creates an independent copy of this ticket.

Returns:
an independent copy of this ticket.
Since:
3.1

initUserSpecificSettings

void initUserSpecificSettings()
Initialize user specific settings like formatting options