Class ProjectACL
java.lang.Object
it.uniroma2.art.semanticturkey.project.ProjectACL
This class describes the Access Control List for a given
Project. It consists in:
- a list of
ProjectConsumers, together with their access permissions. - a "lockable" property, telling if the project associated to this ACL, can be locked for use by a
ProjectConsumer, and with which modality
- Author:
- Manuel Fiorelli <fiorelli@info.uniroma2.it>, Armando Stellato <stellato@info.uniroma2.it>, Andrea Turbati <turbati@info.uniroma2.it>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetAccessLevelForConsumer(ProjectConsumer consumer) This method returns the AccessLevel granted from the project that is owning this ACL to the given consumer.Returns the lock level of the project that is owning this ACLReturns the AccessLevel granted from the project that is owning this ACL to all the consumers ("*" consumer).voidgrantAccess(ProjectConsumer consumer, ProjectACL.AccessLevel reqAccessLevel) voidgrantUniversalAccess(ProjectACL.AccessLevel reqAccessLevel) Grants universally (to all consumer) the given access levelbooleanhasInACL(ProjectConsumer consumer) this method tells if consumerconsumeris listed in the ACL of the current project.booleanisAccessibleFrom(ProjectConsumer consumer, ProjectACL.AccessLevel reqAccessLevel, ProjectACL.LockLevel reqLock) this method tells if the project that is owning this ACL can be accessed with the desired access/lock level specifications.booleanbooleanTells if the project that is owning this ACL can be universally accessed with any levelbooleanisUniversallyAccessible(ProjectACL.AccessLevel reqAccessLevel) Tells if the project that is owning this ACL can be universally accessed with the given levelvoidrevokeAccess(ProjectConsumer consumer) voidRevokes the universal access levelstatic StringserializeACL(String consumerName, ProjectACL.AccessLevel accessLevel) serialization of the ACL for a specific consumer.static Stringserialization of the whole ACL (of a project), containing all of its consumers and access levelsvoidsetLockableWithLevel(ProjectACL.LockLevel lockLevel)
-
Field Details
-
ACL
- See Also:
-
LOCKLEVEL
- See Also:
-
WILDCARD_CONSUMER
- See Also:
-
-
Method Details
-
isLockable
public boolean isLockable() -
getAccessLevelForConsumer
This method returns the AccessLevel granted from the project that is owning this ACL to the given consumer.nullif no AccessLevel is specified for the consumer.- Parameters:
consumer-- Returns:
-
getUniversalAccessLevel
Returns the AccessLevel granted from the project that is owning this ACL to all the consumers ("*" consumer).nullif no AccessLevel is specified.- Returns:
-
getLockLevel
Returns the lock level of the project that is owning this ACL- Returns:
-
isAccessibleFrom
public boolean isAccessibleFrom(ProjectConsumer consumer, ProjectACL.AccessLevel reqAccessLevel, ProjectACL.LockLevel reqLock) this method tells if the project that is owning this ACL can be accessed with the desired access/lock level specifications.
This is not considering the runtime status of the project, in case it has already been accessed by anotherProjectConsumer- Parameters:
consumer-reqAccessLevel-reqLock-- Returns:
-
isUniversallyAccessible
public boolean isUniversallyAccessible()Tells if the project that is owning this ACL can be universally accessed with any level- Returns:
-
isUniversallyAccessible
Tells if the project that is owning this ACL can be universally accessed with the given level- Returns:
-
hasInACL
this method tells if consumerconsumeris listed in the ACL of the current project. This does not tell anything about theProjectACL.AccessLevelnor theProjectACL.LockLevelwhich would be accepted for a request from consumer- Parameters:
consumer-- Returns:
-
grantAccess
public void grantAccess(ProjectConsumer consumer, ProjectACL.AccessLevel reqAccessLevel) throws ProjectUpdateException, ReservedPropertyUpdateException -
grantUniversalAccess
public void grantUniversalAccess(ProjectACL.AccessLevel reqAccessLevel) throws ProjectUpdateException, ReservedPropertyUpdateException Grants universally (to all consumer) the given access level- Parameters:
reqAccessLevel-- Throws:
ProjectUpdateExceptionReservedPropertyUpdateException
-
revokeAccess
public void revokeAccess(ProjectConsumer consumer) throws ProjectUpdateException, ReservedPropertyUpdateException -
revokeUniversalAccess
Revokes the universal access level -
setLockableWithLevel
public void setLockableWithLevel(ProjectACL.LockLevel lockLevel) throws ProjectUpdateException, ReservedPropertyUpdateException -
serializeACL
serialization of the ACL for a specific consumer.- Parameters:
consumerName-accessLevel-- Returns:
-
serializeACL
serialization of the whole ACL (of a project), containing all of its consumers and access levels- Parameters:
acl-- Returns:
-