public XMLValue computeCurrentuserPrivilegeSet(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
XMLValue xmlValue = new XMLValue();
NamespaceConfig config = nsaToken.getNamespaceConfig();
Structure structure = nsaToken.getStructureHelper();
ObjectNode object = structure.retrieve(sToken, revisionDescriptors.getUri());
// check read-own-permissions permission
Security security = nsaToken.getSecurityHelper();
security.checkCredentials(sToken, object, config.getReadOwnPermissionsAction());
try {
String actionsPath = config.getActionsPath();
Uri actionsPathUri = nsaToken.getUri(sToken, actionsPath);
ObjectNode actionsPathNode = actionsPathUri.getStore().retrieveObject(actionsPathUri);
Enumeration actions = actionsPathNode.enumerateChildren();
while (actions.hasMoreElements()) {
ActionNode aNode = ActionNode.getActionNode((String)actions.nextElement());
if (security.hasPermission(sToken, object, aNode)) {
xmlValue.add(createPrivilege(aNode.getPath().lastSegment()));
}