Skip to content
Browse files

Renamed 'authority' to 'owner' on request of Dmitriy

  • Loading branch information...
1 parent 89d1280 commit 820a47e26b912ab74bf033dca4a453ad5cdb3fb5 @adamretter adamretter committed Jan 22, 2014
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/org/exist/xquery/functions/securitymanager/PermissionsFunctions.java
View
16 src/org/exist/xquery/functions/securitymanager/PermissionsFunctions.java
@@ -179,7 +179,7 @@
"Changes the owner of a resource or collection.",
new SequenceType[] {
new FunctionParameterSequenceType("path", Type.ANY_URI, Cardinality.EXACTLY_ONE, "The path to the resource or collection whoose owner you wish to set"),
- new FunctionParameterSequenceType("authority", Type.STRING, Cardinality.EXACTLY_ONE, "The name of the user owner to set on the resource or collection e.g. 'guest'. You may also provide a group owner, by using the syntax 'user:group' if you wish."),
+ new FunctionParameterSequenceType("owner", Type.STRING, Cardinality.EXACTLY_ONE, "The name of the user owner to set on the resource or collection e.g. 'guest'. You may also provide a group owner, by using the syntax 'user:group' if you wish."),
},
new SequenceType(Type.EMPTY, Cardinality.ZERO)
);
@@ -275,8 +275,8 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro
final String mode = args[1].itemAt(0).getStringValue();
result = functionChMod(pathUri, mode);
} else if(isCalledAs(qnChOwn.getLocalName())) {
- final String authority = args[1].itemAt(0).getStringValue();
- result = functionChOwn(pathUri, authority);
+ final String owner = args[1].itemAt(0).getStringValue();
+ result = functionChOwn(pathUri, owner);
} else if(isCalledAs(qnChGrp.getLocalName())) {
final String groupname = args[1].itemAt(0).getStringValue();
result = functionChGrp(pathUri, groupname);
@@ -394,16 +394,16 @@ public void modify(final Permission permission) throws PermissionDeniedException
return Sequence.EMPTY_SEQUENCE;
}
- private Sequence functionChOwn(final XmldbURI pathUri, final String authority) throws PermissionDeniedException {
+ private Sequence functionChOwn(final XmldbURI pathUri, final String owner) throws PermissionDeniedException {
PermissionFactory.updatePermissions(context.getBroker(), pathUri, new PermissionModifier(){
@Override
public void modify(final Permission permission) throws PermissionDeniedException {
- if(authority.indexOf(OWNER_GROUP_SEPARATOR) > -1) {
- permission.setOwner(authority.substring(0, authority.indexOf((OWNER_GROUP_SEPARATOR))));
- permission.setGroup(authority.substring(authority.indexOf(OWNER_GROUP_SEPARATOR) + 1));
+ if(owner.indexOf(OWNER_GROUP_SEPARATOR) > -1) {
+ permission.setOwner(owner.substring(0, owner.indexOf((OWNER_GROUP_SEPARATOR))));
+ permission.setGroup(owner.substring(owner.indexOf(OWNER_GROUP_SEPARATOR) + 1));
} else {
- permission.setOwner(authority);
+ permission.setOwner(owner);
}
}
});

0 comments on commit 820a47e

Please sign in to comment.
Something went wrong with that request. Please try again.