|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Method Summary | |
void |
addAddable(String profile,
String resourceExpr)
Adds an addable resources set to a profile (collection dedicated). |
void |
addCreatable(String profile,
String resourceExpr)
Adds a creatable resources set to a profile (collection dedicated). |
void |
addFilter(CollectionItem collection,
MethodItem filter)
For the specified collection, apply a filter on its getter, so that some items can be hidden depending on the user. |
void |
addOwnerFilter(String profile,
ClassItem cl,
String collectionName)
For the specified collection, users will only see the objects that they own. |
void |
addReadable(String profile,
String resourceExpr)
Adds a readable resources set to a profile. |
void |
addRemovable(String profile,
String resourceExpr)
Adds an removable resources set to a profile (collection dedicated). |
void |
addWritable(String profile,
String resourceExpr)
Adds a writable resources set to a profile. |
void |
autoInitClasses(String classExpr)
This method should affect all the classes that define a reference towards a user of the application and that should be seamlessly initialized to the currently logged user (instead of been filled in interactively). |
void |
clearProfile(String name)
Use this config method to clear a profile so that it can be reinitialized from the config file. |
void |
declareProfile(String profile)
Declares a new profile (that has no parent). |
void |
declareProfile(String profile,
String parent)
Declares a new profile that inherits from the caracteristics of its parent. |
void |
defineAdministrator(String login,
String password)
Create an administrator user. |
void |
defineHabilitation(ClassItem cli,
MethodItem condition)
Defines a contextual habilitation test for instances of given class (This is a generic method to be used when the habilitation does not fit any simple scheme). |
void |
defineHabilitation(MethodItem condition)
Defines a contextual habilitation test (this is a generic method to be used when the habilitation does not fit any simple scheme). |
void |
setContextualProfile(ClassItem cl,
String field,
String profile)
Set a contextual profile to a reference or a collection that contains user(s). |
void |
setUserClass(ClassItem userClass,
String loginField,
String passwordField,
String profileField)
Sets the class of the application that must be used as a storage for the users. |
Method Detail |
public void setUserClass(ClassItem userClass, String loginField, String passwordField, String profileField)
The users are eventually used to know what user is currently logged into the system so you should define fields that can be used to identify the user.
userClass
- the class that represents the application's
usersloginField
- the field that stores the login (iow the
user's id)passwordField
- the field that stores the password (not
mandatory it no password authentication is performed)profileField
- the field that contains the profile (if
any, can be null)UserPasswordAuthenticator
public void autoInitClasses(String classExpr)
classExpr
- a class pointcut expression that denote all the
classes that should be affected by this behaviorpublic void declareProfile(String profile)
A profile is a kind of user type that has some well-defined
persmissions to access or to modify elements of the configured
application (e.g. the default user.acc
defines an
administrator
profile that grants access and
modification of all the elements).
profile
- the profile's namedeclareProfile(String,String)
public void clearProfile(String name)
name
- name of the profile to clearpublic void declareProfile(String profile, String parent)
All the parent access permissions can be restrained (and only restrained) by the child profile (a permission that is not granted by the parent cannot be granted by the child).
profile
- the profile's nameparent
- the parent profile's namedeclareProfile(String)
public void addReadable(String profile, String resourceExpr)
profile
- the profile's nameresourceExpr
- a regular expression that denotes a set of
resources (based on package.class.member
)public void addWritable(String profile, String resourceExpr)
profile
- the profile's nameresourceExpr
- a regular expression that denotes a set of
resources (based on package.class.member
)public void addRemovable(String profile, String resourceExpr)
profile
- the profile's nameresourceExpr
- a regular expression that denotes a set of
resources (based on package.class.member
)public void addAddable(String profile, String resourceExpr)
profile
- the profile's nameresourceExpr
- a regular expression that denotes a set of
resources (based on package.class.member
)public void addCreatable(String profile, String resourceExpr)
profile
- the profile's nameresourceExpr
- a regular expression that denotes a set of
resources (based on package.class
)public void defineAdministrator(String login, String password)
A user class must have been defined with
setUserClass()
. The administrator user will be
created only if no user with the given login already exist. If
created, the administrator user will be given the
"administrator" profile.
login
- the login name of the administratorpassword
- the password of the administratorsetUserClass(ClassItem,String,String,String)
public void defineHabilitation(MethodItem condition)
condition
- the contextual condition (a static method
that takes the substance, the currently tested item, the
action's type and that returns true if the habilitation is
granted)defineHabilitation(ClassItem,MethodItem)
public void defineHabilitation(ClassItem cli, MethodItem condition)
cli
- the class the test applies tocondition
- the contextual condition (a static method that
takes the substance, the currently tested item, the action's
type (one of GuiAC.VISIBLE, GuiAC.EDITABLE, GuiAC.ADDABLE
or GuiAC.REMOVABLE) and that returns true if the habilitation is
granted)defineHabilitation(MethodItem)
public void addOwnerFilter(String profile, ClassItem cl, String collectionName)
profile
- apply the filter only if the user has this profilecl
- the class holding the collectioncollectionName
- name of the collection attributepublic void addFilter(CollectionItem collection, MethodItem filter)
collection
- the collection to filterfilter
- a static method which takes a Collection (the one
to filter), an Object (the holder of the collection), a
CollectionItem, and a User and returns the filtered collection.public void setContextualProfile(ClassItem cl, String field, String profile)
If one user is added to the given field at runtime, the user will then have the given profile for the current object.
cl
- the class that owns the fieldfield
- the profiled fieldprofile
- the profile to be set contextually
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |