public interface OrgData extends RemoteOrgData
Modifier and Type | Interface and Description |
---|---|
static class |
OrgData.Applications
Predefined applications.
|
static class |
OrgData.OrgTrees
Predefined organization trees.
|
static class |
OrgData.Rights
Predefined rights.
|
static class |
OrgData.Roles
Predefined roles.
|
static class |
OrgData.Users
Predefined users.
|
Modifier and Type | Method and Description |
---|---|
void |
addRoleToSession(Role r,
OrgUnit ou)
Adds a role to the current usersession.
|
void |
addRule(PermissionMapping pm)
Add a permission mapping to the permission system.
|
void |
checkLoginAllowed(User u)
Check if the user is active, not too many unsuccessful logins and system not in admin mode.
|
List<String> |
checkPasswordPolicy(String password)
Check a password against the password policy.
|
void |
checkRight(Right r,
Persistent o)
Check whether the thread user has the right r on object o.
|
void |
clearCachedUserProperties(User u)
Clears the cache for the user properties of the passed user.
|
OrgClass |
createOrgClass()
Create a new OrgClass object.
|
OrgTree |
createOrgTree()
Return a new organizational tree.
|
OrgUnit |
createOrgUnit()
Create a new OrgUnit object.
|
Permission |
createPermission()
Create a new Permission
|
PermissionList |
createPermissionList()
Create a new PermissionList
|
Right |
createRight()
Create a new Right.
|
Role |
createRole()
Create a new Role object.
|
User |
createUser()
Create a new User object.
|
UserRole |
createUserRole()
Create a new user-role relation
|
void |
delete(Persistent o)
Delete the object including right check.
|
void |
deleteCascade(OrgUnit ou)
Delete the passed organizational unit and also objects which are of no use without it.
|
void |
deleteObjectExtension(Persistent obj,
String formclass)
delete the object extension for the given object.
|
<T> T |
get(Class<? extends T> c,
long oid)
Get an object from the org-data database.
|
<T> T |
get(String classname,
long oid)
Get an object from the org-data database.
|
Application |
getApplication(long oid)
Deprecated.
since ep 9.0 and will be removed in ep 10.0.
Use
get(Class, long) with Application .class as first parameter instead. |
<T> T |
getById(Class<? extends T> c,
String id)
Get an object from the org-data database.
|
<T> T |
getById(String classname,
String id)
Get an object from the org-data database.
|
List<OrgUnit> |
getDeptsInScope(OrgUnit ou,
int orgScope,
OrgTree tree)
Returns the list of of organizational units which are in the given scope relatively from the given organizational unit.
|
OrgUnit |
getHomeOrg(User u)
Return the Org.unit where the user has the home role.
|
<T extends Persistent> |
getLogAndVersion(T o,
Date d)
Returns the version of the object at a given date along with the corresponding LogEntry.
|
<T extends Persistent> |
getLogAndVersion(T o,
long vid)
Returns the version of the object at a given version id along with the corresponding LogEntry.
|
List<LogEntry> |
getLogEntries(String classname,
long oid,
Date from,
Date to)
Returns a list of log entries for the specified object (identified by passed oid and classname) which
were made at time t, where from < t < to.
|
Persistent |
getObjectExtension(Persistent obj,
String formclass,
boolean create)
Returns the extension object to a persistent.
|
OrgUnit |
getOrgUnit(long oid)
Deprecated.
since ep 9.0 and will be removed in ep 10.0.
Use
get(Class, long) with OrgUnit .class as first parameter instead. |
String |
getPolicyInfoText(User u)
Checks if there are any hints for the user according to the password policy.
|
List<Exportable> |
getReferencedObjects(Exportable e)
Returns the objects referenced by the given object, including the object itself.
|
Right |
getRight(long oid)
Deprecated.
since ep 9.0 and will be removed in ep 10.0.
Use
get(Class, long) with Right .class as first parameter instead. |
Role |
getRole(long oid)
Deprecated.
since ep 9.0 and will be removed in ep 10.0.
Use
get(Class, long) with Role .class as first parameter instead. |
Map<? extends Role,Set<String>> |
getRoles(User u)
Returns a Map of the roles - and depts - of a user.
|
List<Role> |
getRoles(User u,
OrgUnit d)
Return the roles a user has in a OrgUnit.
|
List<Pair<Role,OrgUnit>> |
getSessionRoles()
Returns all the combinations of role and organizational units that have been assigned to the current usersession.
|
List<OrgUnit> |
getSubOrgs(OrgUnit ou,
OrgTree tree)
Return the list of the organizational units that are below the given oe in the given tree.
|
OrgUnit |
getSuperOrg(OrgUnit ou,
OrgTree tree)
Return the organizational unit that is above the given oe in the given tree.
|
User |
getUser(long oid)
Deprecated.
since ep 9.0 and will be removed in ep 10.0.
Use
get(Class, long) with User .class as first parameter instead. |
Map<String,String> |
getUserProperties(User u)
Get the full list of properties for a user.
|
String |
getUserProperty(User u,
String key)
Use this method to get a user property.
|
<T extends Persistent> |
getVersion(T o,
Date d)
Returns the version of the object at a given date.
|
boolean |
hasRight(User u,
Right r,
Object o)
Checks whether the given user has the given right on the given object.
|
boolean |
hasRight(User u,
Right r,
Persistent o)
Checks whether the given user has the given right on the given object.
|
boolean |
hasRight(User u,
Right r,
Persistent o,
Application app) |
<T extends Persistent> |
hasRightForList(User u,
Right r,
List<? extends T> l,
Application app)
Returns a list containing all the elements of passed list l for which the user has the specified right.
|
<T extends Persistent> |
hasRightForList(User u,
Right r,
List<? extends T> l,
boolean ignoreOrgs,
boolean ignoreSubsts,
Application app)
Returns a list containing all the elements of passed list l for which the user has the specified right.
|
boolean |
hasRole(User u,
Role r,
OrgUnit d,
Application appl)
Has the user u the role r in the org.unit d?
|
boolean |
hasRoleInSession(Role r,
OrgUnit ou)
Checks if the given combination of role and organizational unit has been added to the current usersession.
|
void |
insert(Persistent o)
Insert the object including right check.
|
boolean |
isInTree(OrgUnit ou,
OrgTree tree)
Is the given org-unit in the specified org-tree.
|
<T> List<T> |
list(Class<? extends T> c,
String cond,
String order)
Get a list of objects from the org-data database.
|
<T> List<T> |
list(Class<? extends T> c,
String cond,
String order,
Object... bindVars)
Get a list of objects from the org-data database.
|
List<Persistent> |
list(String classname,
String cond,
String order,
Object... bindVars)
Get a list of objects from the org-data database.
|
Map<User,List<OrgUnit>> |
listUsersWithRole(Role r,
OrgUnit ou,
Application appl)
List the users that have a role
|
<T extends Persistent> |
listWithRightCheck(User u,
Class<? extends T> clazz,
Right right,
Application app,
boolean ignoreDepts,
String condition,
String order,
Object... args)
Returns a list of all objects of the specified object class for which the specified user has the
specified right and for which the condition matches.
|
<T extends Persistent> |
listWithRightCheck(User u,
Class<? extends T> clazz,
String condition,
String order,
Object[] args,
Right right,
Application app,
boolean ignoreDepts)
Deprecated.
|
<T extends Persistent> |
listWithRightCheck(User u,
String classname,
Right right,
Application app,
boolean ignoreDepts,
String condition,
String order,
Object... bindVars)
Returns a list of all objects of the specified object class for which the specified user has the
specified right and for which the condition matches.
|
<T extends Persistent> |
listWithRightCheck(User u,
String classname,
String condition,
String order,
Object[] bindVars,
Right right,
Application app,
boolean ignoreDepts)
Deprecated.
|
LogEntry |
makeLogEntry(Persistent o,
int mode,
long versionid,
String desc)
Create an entry in the log table.
|
boolean |
mayDelete(User u,
Persistent o)
Check whether the user may delete the object.
|
boolean |
mayExecute(User u,
Persistent o)
Check whether the user may execute the object (function).
|
boolean |
mayInsert(User u,
Persistent o)
Check whether the user may create the object (insert it into the database).
|
boolean |
mayUpdate(User u,
Persistent o)
Check whether the user may edit the object.
|
boolean |
mayView(User u,
Persistent o)
Check whether the user may view the object.
|
void |
placeOrgInTree(OrgUnit parent,
OrgUnit child,
OrgTree tree)
Change the organizational hierarchy.
|
void |
removeAllRolesFromSession()
Removes all roles from the current usersession.
|
void |
removeRoleFromSession(Role r,
OrgUnit ou)
Removes a role from the current usersession.
|
User |
setPassword(User u,
String password)
Set the password of a user.
|
void |
setPermissionList(HasPermissionList o,
PermissionList pl)
Set the Permissionlist pl for an object o
|
void |
setUserProperty(User u,
String key,
String value)
Set a user property.
|
void |
update(Persistent o)
Update the object including right check.
|
changeDeferred
<T> T get(Class<? extends T> c, long oid)
get
in interface RemoteOrgData
c
- the classoid
- the unique oid of the object<T> T get(String classname, long oid)
get
in interface RemoteOrgData
classname
- the classnameoid
- the unique oid of the object@Deprecated User getUser(long oid)
get(Class, long)
with User
.class as first parameter instead.getUser
in interface RemoteOrgData
oid
- the unique oid of the objectString getUserProperty(User u, String key)
getUserProperty
in interface RemoteOrgData
u
- The user of which you want to get a property.key
- The property key.String
or null
if
no such property exists.Map<String,String> getUserProperties(User u)
getUserProperties
in interface RemoteOrgData
u
- The user of which you want to get the list.void checkLoginAllowed(User u)
checkLoginAllowed
in interface RemoteOrgData
void setUserProperty(User u, String key, String value)
setUserProperty
in interface RemoteOrgData
u
- The user of which you want to get a property.key
- The property key.value
- The property value. With value null
the property will be removed.@Deprecated Role getRole(long oid)
get(Class, long)
with Role
.class as first parameter instead.getRole
in interface RemoteOrgData
oid
- the unique oid of the object@Deprecated Right getRight(long oid)
get(Class, long)
with Right
.class as first parameter instead.getRight
in interface RemoteOrgData
oid
- the unique oid of the object@Deprecated OrgUnit getOrgUnit(long oid)
get(Class, long)
with OrgUnit
.class as first parameter instead.getOrgUnit
in interface RemoteOrgData
oid
- the unique oid of the object@Deprecated Application getApplication(long oid)
get(Class, long)
with Application
.class as first parameter instead.getApplication
in interface RemoteOrgData
oid
- the unique oid of the object<T> T getById(Class<? extends T> c, String id)
getById
in interface RemoteOrgData
c
- the classid
- the id of the object<T> T getById(String classname, String id)
getById
in interface RemoteOrgData
classname
- the classnameid
- the id of the objectOrgUnit getHomeOrg(User u)
getHomeOrg
in interface RemoteOrgData
u
- the User<T> List<T> list(Class<? extends T> c, String cond, String order)
list
in interface RemoteOrgData
c
- the classcond
- the condition expressionorder
- the order attribute(s), comma-separated if more than one<T> List<T> list(Class<? extends T> c, String cond, String order, Object... bindVars)
list
in interface RemoteOrgData
c
- the classcond
- the condition expressionorder
- the order attribute(s), comma-separated if more than onebindVars
- if the condition contains place holders for binding variables this array should
contain the valuesList<Persistent> list(String classname, String cond, String order, Object... bindVars)
list
in interface RemoteOrgData
classname
- the fully qualified name of the class of the objectcond
- the condition expressionorder
- the order attribute(s), comma-separated if more than onebindVars
- if the condition contains place holders for binding variables this array should
contain the valuesMap<? extends Role,Set<String>> getRoles(User u)
getRoles
in interface RemoteOrgData
u
- the userList<Role> getRoles(User u, OrgUnit d)
getRoles
in interface RemoteOrgData
u
- the userd
- the OrgUnitboolean hasRole(User u, Role r, OrgUnit d, Application appl)
hasRole
in interface RemoteOrgData
u
- the userr
- the roled
- the OrgUnitvoid addRule(PermissionMapping pm)
addRule
in interface RemoteOrgData
pm
- the permission mappingboolean hasRight(User u, Right r, Object o)
hasRight
in interface RemoteOrgData
u
- the userr
- the righto
- the object may be null, must be a Persistentboolean hasRight(User u, Right r, Persistent o)
hasRight
in interface RemoteOrgData
u
- the userr
- the righto
- the object (may be null)boolean hasRight(User u, Right r, Persistent o, Application app)
hasRight
in interface RemoteOrgData
<T extends Persistent> List<T> hasRightForList(User u, Right r, List<? extends T> l, Application app)
hasRightForList
in interface RemoteOrgData
u
- the userr
- the rightl
- the list containing the unchecked elementsapp
- the application for referencing an org-tree<T extends Persistent> List<T> hasRightForList(User u, Right r, List<? extends T> l, boolean ignoreOrgs, boolean ignoreSubsts, Application app)
hasRightForList
in interface RemoteOrgData
u
- the userr
- the rightl
- the list containing the unchecked elementsignoreOrgs
- ignore permissions defined for org-unit scopesignoreSubsts
- ignore permissions defined for persons u substitutesapp
- the application for referencing an org-tree@Deprecated <T extends Persistent> List<T> listWithRightCheck(User u, Class<? extends T> clazz, String condition, String order, Object[] args, Right right, Application app, boolean ignoreDepts)
listWithRightCheck(User,Class,Right,Application,boolean,String,String,Object...)
insteadlistWithRightCheck
in interface RemoteOrgData
u
- the userclazz
- class which instances are wantedcondition
- a SQL conditionorder
- a comma separated list of attribute names of the given class.args
- if the condition contains place holders for binding variables this array should
contain the valuesright
- the rightapp
- the application which department tree should be used for checkingignoreDepts
- ignore the right a user has via dept scope<T extends Persistent> List<T> listWithRightCheck(User u, Class<? extends T> clazz, Right right, Application app, boolean ignoreDepts, String condition, String order, Object... args)
listWithRightCheck
in interface RemoteOrgData
u
- the userclazz
- class which instances are wantedright
- the rightapp
- the application which department tree should be used for checkingignoreDepts
- ignore the right a user has via dept scopecondition
- a SQL conditionorder
- a comma separated list of attribute names of the given class.args
- values for binding variables in condition@Deprecated <T extends Persistent> List<T> listWithRightCheck(User u, String classname, String condition, String order, Object[] bindVars, Right right, Application app, boolean ignoreDepts)
listWithRightCheck(User,String,Right,Application,boolean,String,String,Object...)
insteadlistWithRightCheck
in interface RemoteOrgData
u
- the userclassname
- the fully qualified name of the class of the objectcondition
- a SQL conditionorder
- a comma separated list of attribute names of the given class.bindVars
- if the condition contains place holders for binding variables this array should
contain the valuesright
- the rightapp
- the application which department tree should be used for checkingignoreDepts
- ignore the right a user has via dept scope<T extends Persistent> List<T> listWithRightCheck(User u, String classname, Right right, Application app, boolean ignoreDepts, String condition, String order, Object... bindVars)
listWithRightCheck
in interface RemoteOrgData
u
- the userclassname
- the fully qualified name of the class of the objectright
- the rightapp
- the application which department tree should be used for checkingignoreDepts
- ignore the right a user has via dept scopecondition
- a SQL conditionorder
- a comma separated list of attribute names of the given class.bindVars
- values for binding variables in conditionvoid checkRight(Right r, Persistent o)
checkRight
in interface RemoteOrgData
r
- a righto
- an object (optional)boolean mayInsert(User u, Persistent o)
mayInsert
in interface RemoteOrgData
u
- the user requesting the accesso
- the objectboolean mayUpdate(User u, Persistent o)
mayUpdate
in interface RemoteOrgData
u
- the user requesting the accesso
- the objectboolean mayView(User u, Persistent o)
mayView
in interface RemoteOrgData
u
- the user requesting the accesso
- the objectboolean mayExecute(User u, Persistent o)
mayExecute
in interface RemoteOrgData
u
- the user requesting the accesso
- the objectboolean mayDelete(User u, Persistent o)
mayDelete
in interface RemoteOrgData
u
- the user requesting the accesso
- the objectvoid insert(Persistent o)
insert
in interface RemoteOrgData
o
- the objectvoid update(Persistent o)
update
in interface RemoteOrgData
o
- the objectvoid delete(Persistent o)
delete
in interface RemoteOrgData
o
- the object<T extends Persistent> T getVersion(T o, Date d)
getVersion
in interface RemoteOrgData
o
- the objectd
- the date<T extends Persistent> Pair<LogEntry,T> getLogAndVersion(T o, Date d)
getLogAndVersion
in interface RemoteOrgData
o
- the objectd
- the date<T extends Persistent> Pair<LogEntry,T> getLogAndVersion(T o, long vid)
getLogAndVersion
in interface RemoteOrgData
o
- the objectvid
- the version idList<LogEntry> getLogEntries(String classname, long oid, Date from, Date to)
getLogEntries
in interface RemoteOrgData
classname
- the fully qualified name of the class of the objectoid
- the oid of the objectfrom
- the date for the start of the range (may be null)to
- the date for the end of the range (may be null)LogEntry makeLogEntry(Persistent o, int mode, long versionid, String desc)
makeLogEntry
in interface RemoteOrgData
o
- the logged objectmode
- the change mode, choose one of LogEntry constantsversionid
- a number identifying the versiondesc
- a description testMap<User,List<OrgUnit>> listUsersWithRole(Role r, OrgUnit ou, Application appl)
listUsersWithRole
in interface RemoteOrgData
r
- the roleou
- optional: the orgunit where the role is assignedappl
- optional application, necessary when checking hierarchic roles to
use the correct department tree. if the argument is null the default tree is used.List<String> checkPasswordPolicy(String password)
checkPasswordPolicy
in interface RemoteOrgData
password
- - the password string to check against the policyString getPolicyInfoText(User u)
getPolicyInfoText
in interface RemoteOrgData
u
- - the userUser setPassword(User u, String password)
setPassword
in interface RemoteOrgData
u
- the user, whose password should be changedpassword
- - the new password (plain string)User createUser()
createUser
in interface RemoteOrgData
Role createRole()
createRole
in interface RemoteOrgData
Right createRight()
createRight
in interface RemoteOrgData
OrgUnit createOrgUnit()
createOrgUnit
in interface RemoteOrgData
OrgClass createOrgClass()
createOrgClass
in interface RemoteOrgData
UserRole createUserRole()
createUserRole
in interface RemoteOrgData
Permission createPermission()
createPermission
in interface RemoteOrgData
PermissionList createPermissionList()
createPermissionList
in interface RemoteOrgData
void setPermissionList(HasPermissionList o, PermissionList pl)
setPermissionList
in interface RemoteOrgData
void deleteCascade(OrgUnit ou)
deleteCascade
in interface RemoteOrgData
ou
- the organizational unit to deleteList<OrgUnit> getSubOrgs(OrgUnit ou, OrgTree tree)
getSubOrgs
in interface RemoteOrgData
OrgUnit getSuperOrg(OrgUnit ou, OrgTree tree)
getSuperOrg
in interface RemoteOrgData
OrgTree createOrgTree()
createOrgTree
in interface RemoteOrgData
void placeOrgInTree(OrgUnit parent, OrgUnit child, OrgTree tree)
placeOrgInTree
in interface RemoteOrgData
tree
- the treeboolean isInTree(OrgUnit ou, OrgTree tree)
isInTree
in interface RemoteOrgData
List<OrgUnit> getDeptsInScope(OrgUnit ou, int orgScope, OrgTree tree)
getDeptsInScope
in interface RemoteOrgData
ou
- the organizational unit to start withorgScope
- the scope c.f. Permission
tree
- the treePersistent getObjectExtension(Persistent obj, String formclass, boolean create)
getObjectExtension
in interface RemoteOrgData
obj
- an object having extensionsformclass
- the name of a form-classcreate
- if true extensions are createdvoid deleteObjectExtension(Persistent obj, String formclass)
deleteObjectExtension
in interface RemoteOrgData
void clearCachedUserProperties(User u)
clearCachedUserProperties
in interface RemoteOrgData
u
- the Uservoid addRoleToSession(Role r, OrgUnit ou)
addRoleToSession
in interface RemoteOrgData
r
- the role to add. Must not be null.ou
- the organizational unit. If the role is a global one, this must be null, else an organizational unit must be provided.void removeRoleFromSession(Role r, OrgUnit ou)
removeRoleFromSession
in interface RemoteOrgData
r
- the role to remove. Must not be null.ou
- the organizational unit; if null, then the role will be removed regardless of the organizational unit.void removeAllRolesFromSession()
removeAllRolesFromSession
in interface RemoteOrgData
boolean hasRoleInSession(Role r, OrgUnit ou)
hasRoleInSession
in interface RemoteOrgData
r
- the role, if null then a specific role is not taken into accountou
- the organizational unit; if null then a specific organizational unit is not taken into account.List<Pair<Role,OrgUnit>> getSessionRoles()
getSessionRoles
in interface RemoteOrgData
List<Exportable> getReferencedObjects(Exportable e) throws Exception
RemoteOrgData
getReferencedObjects
in interface RemoteOrgData
e
- an Exportable (User, Role, ProcessDefinition)Exception
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.