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
ProjectConsumer
s, 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
Modifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
-
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).void
grantAccess
(ProjectConsumer consumer, ProjectACL.AccessLevel reqAccessLevel) void
grantUniversalAccess
(ProjectACL.AccessLevel reqAccessLevel) Grants universally (to all consumer) the given access levelboolean
hasInACL
(ProjectConsumer consumer) this method tells if consumerconsumer
is listed in the ACL of the current project.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.boolean
boolean
Tells if the project that is owning this ACL can be universally accessed with any levelboolean
isUniversallyAccessible
(ProjectACL.AccessLevel reqAccessLevel) Tells if the project that is owning this ACL can be universally accessed with the given levelvoid
revokeAccess
(ProjectConsumer consumer) void
Revokes the universal access levelstatic String
serializeACL
(String consumerName, ProjectACL.AccessLevel accessLevel) serialization of the ACL for a specific consumer.static String
serialization of the whole ACL (of a project), containing all of its consumers and access levelsvoid
setLockableWithLevel
(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.null
if 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).null
if 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 consumerconsumer
is listed in the ACL of the current project. This does not tell anything about theProjectACL.AccessLevel
nor theProjectACL.LockLevel
which 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:
ProjectUpdateException
ReservedPropertyUpdateException
-
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:
-