|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
mysql.AbstractSql
mysql.PermissionSql
public class PermissionSql
A class that holds various permissions for users.
CREATE TABLE "perm" ( propid | character varying(255) | user | character varying(255) | permision | smallint | su | boolean |In this setup, the columns have the following meanings:
TaskSql table.UserSql user-id.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static String |
DEFPERMISSIONFIELD
The key to the object name in the database. |
private static String |
DEFPROPIDFIELD
The key to the object name in the database. |
private static String |
DEFSUFIELD
The key to the object name in the database. |
private static String |
DEFTABLE
The default table name. |
private static String |
DEFUSERFIELD
The key to the object name in the database. |
static String |
KEY_PERMISSIONFIELD
The key to the object name in the database. |
static String |
KEY_PROPIDFIELD
The key to the object name in the database. |
static String |
KEY_SUFIELD
The key to the object name in the database. |
static String |
KEY_USERFIELD
The key to the object name in the database. |
| Fields inherited from class mysql.AbstractSql |
|---|
KEY_TABLE |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
PermissionSql(Map<String,String> prop)
Constructs a new proposal sql. |
|
| Method Summary | |
|---|---|
PermissionCollection |
addProposalPermissions(PermissionCollection permit,
String user)
Add to a PermissionCollection the permissions for the user on
all additional proposals. |
boolean |
setMainUserPermission(String proposal,
String pi)
For the pi, we set all permission to true plus the su-filed. |
private boolean |
setRow(String prop,
String user,
short perm,
boolean su)
|
boolean |
setTeamUserPermission(String proposal,
String coi)
Set permissions for a standard user (team member). |
boolean |
setUserPermission(String proposal,
String coi,
EnumSet<DataPermission.Access> perms)
|
| Methods inherited from class mysql.AbstractSql |
|---|
getPassword, getTable, getUserName, init, isEntry |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_PROPIDFIELD
public static final String KEY_USERFIELD
public static final String KEY_PERMISSIONFIELD
public static final String KEY_SUFIELD
private static final String DEFTABLE
private static final String DEFPROPIDFIELD
private static final String DEFUSERFIELD
private static final String DEFPERMISSIONFIELD
private static final String DEFSUFIELD
| Constructor Detail |
|---|
public PermissionSql(Map<String,String> prop)
| Method Detail |
|---|
public PermissionCollection addProposalPermissions(PermissionCollection permit,
String user)
PermissionCollection the permissions for the user on
all additional proposals. The database is queried and permissions
in the form of
:user:propid,Please note that expired targets are not added here, refer to
#addExpiredPermissions
SecurityException - if the permission collection is read-only.
public boolean setMainUserPermission(String proposal,
String pi)
public boolean setTeamUserPermission(String proposal,
String coi)
public boolean setUserPermission(String proposal,
String coi,
EnumSet<DataPermission.Access> perms)
private boolean setRow(String prop,
String user,
short perm,
boolean su)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||