public class PermissionHandler extends java.lang.Object implements java.io.Serializable, PermissionHandlerWithUserI
Constructor and Description |
---|
PermissionHandler(DBManLocalI _dbm,
Benutzer _user) |
Modifier and Type | Method and Description |
---|---|
void |
addZuweisung(EntityI ent,
RechteZuweisung r) |
PermissionHandlerDecisionI |
checkCreateAllowed(BOI boi) |
PermissionHandlerDecisionI |
checkCreateAllowed(BOI boi,
java.lang.String att) |
PermissionHandlerDecisionI |
checkCreateAllowed(java.lang.Class<? extends BOI> clazz) |
PermissionHandlerDecisionI |
checkCreateAllowed(java.lang.Class<? extends BOI> clazz,
java.lang.String att) |
PermissionHandlerDecisionI |
checkCreateAllowed(java.lang.Class<? extends BOI> clazz,
java.lang.String att,
boolean _tendToAllow)
Checks if the current user is allowed to create objects (or if
given the value of the specified attribute) of the given class.
|
PermissionHandlerDecisionI |
checkDeleteAllowed(BOI boi) |
PermissionHandlerDecisionI |
checkDeleteAllowed(BOI boi,
java.lang.String att) |
PermissionHandlerDecisionI |
checkReadAllowed(BOI boi) |
PermissionHandlerDecisionI |
checkReadAllowed(BOI boi,
java.lang.String att) |
PermissionHandlerDecisionI |
checkReadAllowed(java.lang.Class<? extends BOI> clazz) |
PermissionHandlerDecisionI |
checkReadAllowed(java.lang.Class<? extends BOI> clazz,
java.lang.String att) |
PermissionHandlerDecisionI |
checkReadAllowed(java.lang.Class<? extends BOI> clazz,
java.lang.String att,
boolean _tendToAllow)
Checks if the current user is allowed to read objects (or if
given the value of the specified attribute) of the given class.
|
PermissionHandlerDecisionI |
checkWriteAllowed(BOI boi) |
PermissionHandlerDecisionI |
checkWriteAllowed(BOI boi,
java.lang.String att) |
PermissionHandlerDecisionI |
checkWriteAllowed(java.lang.Class<? extends BOI> clazz) |
PermissionHandlerDecisionI |
checkWriteAllowed(java.lang.Class<? extends BOI> clazz,
java.lang.String att) |
PermissionHandlerDecisionI |
checkWriteAllowed(java.lang.Class<? extends BOI> clazz,
java.lang.String att,
boolean _tendToAllow)
Checks if the current user is allowed to write objects (or if
given the value of the specified attribute) of the given class.
|
PermissionHandlerDecisionI |
checkXAllowed(BOI boi,
java.lang.Class<? extends BOI> clazz,
java.lang.String att,
int what,
java.lang.String desc,
java.lang.String letter,
boolean botDecision)
Checks permissions of type X (read, write, ...) for a given
BOI and/or Class and returns the
decision (basically "granted" or "denied"). |
PermissionHandlerDecisionI |
checkXAllowed(BOI boi,
java.lang.Class<? extends BOI> clazz,
java.lang.String att,
int what,
java.lang.String desc,
java.lang.String letter,
boolean botDecision,
boolean tendToAllow) |
SchemaI |
getSchema() |
Benutzer |
getUser()
The structure of this class is optimized to give a fast yes or no answer to a given permission (read/write/create/delete).
|
void |
init() |
void |
initMasken()
used on client-side to initialize BOMasken of serialized transmitted PermissionHandler
|
boolean |
isAllowWriteIfNew() |
void |
setAllowWriteIfNew(boolean $23) |
void |
setSchema(SchemaI $22) |
void |
setUser(Benutzer $21) |
public PermissionHandler(DBManLocalI _dbm, Benutzer _user)
public void init()
public void addZuweisung(EntityI ent, RechteZuweisung r)
public void initMasken()
initMasken
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkXAllowed(BOI boi, java.lang.Class<? extends BOI> clazz, java.lang.String att, int what, java.lang.String desc, java.lang.String letter, boolean botDecision)
BOI
and/or Class
and returns the
decision (basically "granted" or "denied").boi
- the concreate object instance for which permissions should be checked; may be null if only a generic
check for the whole class should be performedclazz
- the class of objects for which permissions should be checked; may be null if boi
is given.
If boi
as well as clazz
are given the latter must match boi.getClass()
att
- an attribute for which permissions should be checked, instead of a check for the whole object; may be
nullwhat
- the type of permission to check (read, write, ...) given as one of the constants
PermissionHandlerDecision.PERMIT*
desc
- a textual description of the permission to check ("READ", "WRITE", ...) ; only used in debug log
outputletter
- a unique letter associated with the permission to check; used for creating a key for the
permission decision cache.botDecision
- permissions for the BOT
class are handled specially; if true permission will be
granted for this class or object instances of it; if false it will be deniedtendToAllow
- determines how RZs whose BOMaske has a script (and thus may match some objects of the class
and some not) and errors during the evaluation of such scripts will be handled. If false such RZs will be
counted as "not present" and if only such RZs exist for the class, the default behaviour (which is to to deny)
will take place; the default return value in case of an error in the BOMaske script will also be false, that is
the BOMaske will be assumed to NOT fit and thus an "allowing RZ" is NOT assumed to be present. If this
parameter is true RZs with a BOMaske with a script will be checked (and may be returned as an "allowing RZ");
the default return value in case of an error in the BOMaske script will also be true, that is the BOMaske will
be assumed to fit and thus an "allowing RZ" is assumed to be present.PermissionHandlerDecisionI
representing basically if the permission should be granted or deniedpublic PermissionHandlerDecisionI checkXAllowed(BOI boi, java.lang.Class<? extends BOI> clazz, java.lang.String att, int what, java.lang.String desc, java.lang.String letter, boolean botDecision, boolean tendToAllow)
public PermissionHandlerDecisionI checkReadAllowed(BOI boi)
checkReadAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkReadAllowed(BOI boi, java.lang.String att)
checkReadAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkReadAllowed(java.lang.Class<? extends BOI> clazz)
checkReadAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkReadAllowed(java.lang.Class<? extends BOI> clazz, java.lang.String att)
checkReadAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkReadAllowed(java.lang.Class<? extends BOI> clazz, java.lang.String att, boolean _tendToAllow)
PermissionHandlerI
checkReadAllowed
in interface PermissionHandlerI
clazz
- the class to check for read permission.att
- the attribute to check for read permission._tendToAllow
- determines how RZs whose BOMaske has a script (and thus
may match some objects of the class and some not) and errors during the
evaluation of such scripts will be handled. If false such RZs will be
counted as "not present" and if only such RZs exist for the class, the
default behaviour (which is to to deny) will take place; the default
return value in case of an error in the BOMaske script will also be false,
that is the BOMaske will be assumed to NOT fit and thus an "allowing RZ" is
NOT assumed to be present. If this parameter is true RZs with a BOMaske
with a script will be checked (and may be returned as an "allowing RZ");
the default return value in case of an error in the BOMaske script will also
be true, that is the BOMaske will be assumed to fit and thus an "allowing
RZ" is assumed to be present.public PermissionHandlerDecisionI checkWriteAllowed(BOI boi)
checkWriteAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkWriteAllowed(BOI boi, java.lang.String att)
checkWriteAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkWriteAllowed(java.lang.Class<? extends BOI> clazz)
checkWriteAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkWriteAllowed(java.lang.Class<? extends BOI> clazz, java.lang.String att)
checkWriteAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkWriteAllowed(java.lang.Class<? extends BOI> clazz, java.lang.String att, boolean _tendToAllow)
PermissionHandlerI
checkWriteAllowed
in interface PermissionHandlerI
clazz
- the class to check for write permission.att
- the attribute to check for write permission._tendToAllow
- determines how RZs whose BOMaske has a script (and thus
may match some objects of the class and some not) and errors during the
evaluation of such scripts will be handled. If false such RZs will be
counted as "not present" and if only such RZs exist for the class, the
default behaviour (which is to to deny) will take place; the default
return value in case of an error in the BOMaske script will also be false,
that is the BOMaske will be assumed to NOT fit and thus an "allowing RZ" is
NOT assumed to be present. If this parameter is true RZs with a BOMaske
with a script will be checked (and may be returned as an "allowing RZ");
the default return value in case of an error in the BOMaske script will also
be true, that is the BOMaske will be assumed to fit and thus an "allowing
RZ" is assumed to be present.public PermissionHandlerDecisionI checkCreateAllowed(BOI boi)
checkCreateAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkCreateAllowed(BOI boi, java.lang.String att)
checkCreateAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkCreateAllowed(java.lang.Class<? extends BOI> clazz)
checkCreateAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkCreateAllowed(java.lang.Class<? extends BOI> clazz, java.lang.String att)
checkCreateAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkCreateAllowed(java.lang.Class<? extends BOI> clazz, java.lang.String att, boolean _tendToAllow)
PermissionHandlerI
checkCreateAllowed
in interface PermissionHandlerI
clazz
- the class to check for create permission.att
- FIXME! This does not really make sense here, as create
is relevant only for the whole object._tendToAllow
- determines how RZs whose BOMaske has a script (and thus
may match some objects of the class and some not) and errors during the
evaluation of such scripts will be handled. If false such RZs will be
counted as "not present" and if only such RZs exist for the class, the
default behaviour (which is to to deny) will take place; the default
return value in case of an error in the BOMaske script will also be false,
that is the BOMaske will be assumed to NOT fit and thus an "allowing RZ" is
NOT assumed to be present. If this parameter is true RZs with a BOMaske
with a script will be checked (and may be returned as an "allowing RZ");
the default return value in case of an error in the BOMaske script will also
be true, that is the BOMaske will be assumed to fit and thus an "allowing
RZ" is assumed to be present.public PermissionHandlerDecisionI checkDeleteAllowed(BOI boi)
checkDeleteAllowed
in interface PermissionHandlerI
public PermissionHandlerDecisionI checkDeleteAllowed(BOI boi, java.lang.String att)
checkDeleteAllowed
in interface PermissionHandlerI
public Benutzer getUser()
public void setUser(Benutzer $21)
setUser
in interface PermissionHandlerWithUserI
public SchemaI getSchema()
public void setSchema(SchemaI $22)
setSchema
in interface PermissionHandlerI
public boolean isAllowWriteIfNew()
public void setAllowWriteIfNew(boolean $23)
setAllowWriteIfNew
in interface PermissionHandlerI
Copyright © 2000-2024 OAshi S.à r.l. All Rights Reserved.