Groovy Documentation

utils.gate.cow.sventon
Class CowSventonSession

java.lang.Object
  utils.gate.cow.sventon.CowSventonSession
All Implemented Interfaces:
Serializable

class CowSventonSession

Class encapsulating a "session" giving permissions to the sventon web app.


Field Summary
private boolean admin

Admin flag.

private Map grants

Map from repository name to the set of paths within that repository to which this session has access.

private static long serialVersionUID

Serial version ID.

 
Constructor Summary
CowSventonSession()

 
Method Summary
private Set getGrantsForRepos(String repos, boolean create)

Get the permitted set of paths for a given repository, optionally creating an empty set if there are currently no grants for that repository.

void grant(String repos, String path)

Add permission for the given repository and path to this session.

boolean isAdmin()

boolean isPermitted(String repos, String path)

Check whether the current session permits access to the given repository and path.

void setAdmin(boolean admin)

String toString()

 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Field Detail

admin

private boolean admin
Admin flag. A session with this flag set can do anything.


grants

private Map grants
Map from repository name to the set of paths within that repository to which this session has access.


serialVersionUID

private static final long serialVersionUID
Serial version ID.


 
Constructor Detail

CowSventonSession

CowSventonSession()


 
Method Detail

getGrantsForRepos

private Set getGrantsForRepos(String repos, boolean create)
Get the permitted set of paths for a given repository, optionally creating an empty set if there are currently no grants for that repository.


grant

public void grant(String repos, String path)
Add permission for the given repository and path to this session.


isAdmin

public boolean isAdmin()


isPermitted

public boolean isPermitted(String repos, String path)
Check whether the current session permits access to the given repository and path. An admin session will always return true here, otherwise we check the grants map.


setAdmin

public void setAdmin(boolean admin)


toString

public String toString()


 

Groovy Documentation