|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.soebes.subversion.sapm.AccessRule
public class AccessRule
This class describes an AccessRule which comprises of an repository name and a repository path which is usually defined like the following in the Subversion Access file.
[repository:/trunk] @group = rw harry = rExample:
User userBrian = UserFactory.createInstance("brian"); Group group = new Group("group"); group.add(userBrian) User userHarry = UserFactory.createInstance("harry"); AccessRule accessRule = new AccessRule("repository", "/test/trunk"); accessRule.add(userHarry, AccessLevel.READ); accessRule.add(group, AccessLevel.READ_WRITE); AccessLevel level = accessRule.getAccess("hugo", "repository", "/trunk/test/Test.java"); ....
Field Summary | |
---|---|
private ArrayList<Access> |
accessList
|
private String |
repositoryName
The name of the repository which this AccessRule represents. |
private String |
repositoryPath
The path inside the repository which is represented by this AccessRule. |
Constructor Summary | |
---|---|
AccessRule(String path)
This is used if you have no particular repository defined for example like the following. |
|
AccessRule(String repositoryName,
String path)
This is used if you have given both the repository name and the path within the repository. |
Method Summary | |
---|---|
void |
add(Access access)
Convenience method for usage in grammar. |
void |
add(Group group,
AccessLevel accessLevel)
Add the given group to the access list with it's appropriate AccessLevel . |
void |
add(User user,
AccessLevel accessLevel)
Add the user to the access list with it's appropriate AccessLevel . |
void |
addNegative(Group group,
AccessLevel accessLevel)
Add the given group to the access list with it's appropriate AccessLevel . |
void |
addNegative(User user,
AccessLevel accessLevel)
Add the user to the access list with it's appropriate AccessLevel
but this rule means not this user (~user) |
AccessLevel |
getAccess(String user,
String repository,
String path)
Get the AccessLevel for the user who want's to get access to the path
inside the given repository. |
AccessLevel |
getAccess(User user,
String repository,
String path)
Convenience method if you have a User object instead of user name as a string. |
AccessLevel |
getAccessForPrincipal(String user)
Will get the AccessLevel for the given user. |
AccessLevel |
getAccessForPrincipal(User user)
|
ArrayList<Access> |
getAccessList()
|
String |
getRepositoryName()
|
String |
getRepositoryPath()
|
private void |
init(String repositoryName,
String path)
|
void |
setAccessList(ArrayList<Access> accessList)
|
void |
setRepositoryName(String repositoryName)
|
void |
setRepositoryPath(String path)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private ArrayList<Access> accessList
private String repositoryName
private String repositoryPath
Constructor Detail |
---|
public AccessRule(String path)
[/test/trunk] ...
path
- public AccessRule(String repositoryName, String path)
repositoryName
- The name of the repository.path
- The path inside the repository.Method Detail |
---|
private void init(String repositoryName, String path)
public String getRepositoryName()
public void setRepositoryName(String repositoryName)
public String getRepositoryPath()
public void setRepositoryPath(String path)
public void setAccessList(ArrayList<Access> accessList)
public ArrayList<Access> getAccessList()
public void add(User user, AccessLevel accessLevel)
AccessLevel
.
user
- The user which will be used.accessLevel
- The accessLevel which will be given to the user.public void addNegative(User user, AccessLevel accessLevel)
AccessLevel
but this rule means not this user (~user)
user
- The user which it shouldn't be.accessLevel
- The level of access for the non users.public void add(Group group, AccessLevel accessLevel)
AccessLevel
.
group
- The group which will be added to the access list.accessLevel
- The accessLevel which will be given to the group.public void addNegative(Group group, AccessLevel accessLevel)
AccessLevel
.
Negate the rule.
~group = rwThis means that everybody who is NOT member of the group will get the permission (rw).
group
- The group which will be added to the access list.accessLevel
- The accessLevel which will be given to the group.public void add(Access access)
access
- The Access
public AccessLevel getAccess(User user, String repository, String path)
User
object instead of user name as a string.
user
- The user for which you like to know the access level.repository
- The repository which will be checked for.path
- The path within the repository.
public AccessLevel getAccess(String user, String repository, String path)
AccessLevel
for the user who want's to get access to the path
inside the given repository.
user
- The user who will be checked against the permission rules.repository
- The repository to which the user tries to get access.path
- The path within the repository.
public AccessLevel getAccessForPrincipal(User user)
public AccessLevel getAccessForPrincipal(String user)
AccessLevel
for the given user.
user
- The user which will be searched for.
AccessLevel
of the given user @{link AccessLevel.NOTHING} if
the user will not be found.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |