You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by oz...@apache.org on 2004/10/27 10:29:02 UTC
cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/util PropertyHelper.java
ozeigermann 2004/10/27 01:29:01
Modified: src/share/org/apache/slide/security SecurityImpl.java
src/share/org/apache/slide/structure StructureImpl.java
src/webdav/server/org/apache/slide/webdav/util
PropertyHelper.java
Log:
Applied patch for 31907 and 31908 contributed by Warwick Burrows
Revision Changes Path
1.56 +18 -18 jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java
Index: SecurityImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- SecurityImpl.java 7 Oct 2004 13:16:19 -0000 1.55
+++ SecurityImpl.java 27 Oct 2004 08:28:59 -0000 1.56
@@ -1077,9 +1077,9 @@
* @throws SlideException
* @throws JDOMException
*/
- private static synchronized Set getActionAggregates(SecurityImpl security, ActionNode aNode) throws SlideException, JDOMException {
+ private static synchronized Set getActionAggregates(SecurityImpl security, SlideToken token, ActionNode aNode) throws SlideException, JDOMException {
Set result = new HashSet();
- Uri aNodeUri = security.namespace.getUri(aNode.getUri());
+ Uri aNodeUri = security.namespace.getUri(token, aNode.getUri());
NodeRevisionDescriptor aNrd = aNodeUri.getStore().retrieveRevisionDescriptor(aNodeUri, new NodeRevisionNumber());
NodeProperty membersProp = aNrd.getProperty(PRIVILEGE_MEMBER_SET);
if (membersProp != null && membersProp.getValue() != null) {
@@ -1227,9 +1227,9 @@
* Method getActionAggregation
* @return a Map: actionNode -> Set-of-aggregated-nodes (direct aggregates)
*/
- public Map getActionAggregation() {
+ public Map getActionAggregation(SlideToken token) {
logger.log("Action aggregation being retrieved", LOG_CHANNEL, Logger.DEBUG);
- return Collections.unmodifiableMap(getActionAggregationImpl(this));
+ return Collections.unmodifiableMap(getActionAggregationImpl(this, token));
}
/**
@@ -1318,16 +1318,16 @@
* @param namespace
* @param namespaceConfig
*/
- private static synchronized void loadActionsCache(SecurityImpl security) {
+ private static synchronized void loadActionsCache(SecurityImpl security, SlideToken token) {
ActionsCache cache = getActionsCache(security);
try {
cache.aggregation = new HashMap();
cache.aggregationClosure = new HashMap();
String actionsPath = security.namespaceConfig.getActionsPath();
- Uri actionsPathUri = security.namespace.getUri(actionsPath);
+ Uri actionsPathUri = security.namespace.getUri(token, actionsPath);
ObjectNode actionsPathNode = actionsPathUri.getStore().retrieveObject(actionsPathUri);
Enumeration actions = actionsPathNode.enumerateChildren();
- addActionLeafsToActionAggregation(security, cache, actions);
+ addActionLeafsToActionAggregation(security, token, cache, actions);
Iterator keys = cache.aggregationClosure.keySet().iterator();
while (keys.hasNext()) {
@@ -1367,15 +1367,15 @@
* @throws SlideException
* @throws JDOMException
*/
- private static synchronized void addActionLeafsToActionAggregation(SecurityImpl security, ActionsCache cache, Enumeration actions) throws SlideException, JDOMException {
+ private static synchronized void addActionLeafsToActionAggregation(SecurityImpl security, SlideToken token, ActionsCache cache, Enumeration actions) throws SlideException, JDOMException {
while (actions.hasMoreElements()) {
- Uri aNodeUri = security.namespace.getUri((String)actions.nextElement());
+ Uri aNodeUri = security.namespace.getUri(token, (String)actions.nextElement());
ObjectNode oNode = security.namespace.getStore(aNodeUri.getScope()).retrieveObject(aNodeUri);
if (oNode.hasChildren()) {
if (security.logger.isEnabled(Logger.DEBUG)) {
security.logger.log("Adding children of action " + oNode.getUri() + " to action aggregation", LOG_CHANNEL, Logger.DEBUG);
}
- addActionLeafsToActionAggregation(security, cache, oNode.enumerateChildren());
+ addActionLeafsToActionAggregation(security, token, cache, oNode.enumerateChildren());
} else {
if (security.logger.isEnabled(Logger.DEBUG)) {
security.logger.log("Adding action " + oNode.getUri() + " to action aggregation", LOG_CHANNEL, Logger.DEBUG);
@@ -1390,7 +1390,7 @@
actionNamespace = org.jdom.Namespace.getNamespace("DAV:");
}
aNode = ActionNode.getActionNode(oNode.getUri(), actionNamespace);
- Set directAggregates = getActionAggregates(security, aNode);
+ Set directAggregates = getActionAggregates(security, token, aNode);
cache.aggregation.put(aNode, directAggregates);
Set aClosure = new HashSet();
aClosure.add(aNode);
@@ -1438,10 +1438,10 @@
* @return A map from actions to their aggregated actions, or and empty map
* if loading of the actions cache failed.
*/
- private static synchronized Map getActionAggregationImpl(SecurityImpl security) {
+ private static synchronized Map getActionAggregationImpl(SecurityImpl security, SlideToken token) {
ActionsCache cache = getActionsCache(security);
if (!cache.hasBeenLoaded()) {
- loadActionsCache(security);
+ loadActionsCache(security, token);
}
if (cache.hasLoadingFailed) {
security.logger.log("actionAggregation retrieved but cache didn't load successfully" , LOG_CHANNEL, Logger.WARNING);
@@ -1463,7 +1463,7 @@
private static synchronized Map getActionAggregationClosureImpl(SecurityImpl security, SlideToken token, String uri) throws ServiceAccessException {
ActionsCache cache = getActionsCache(security);
if (!cache.hasBeenLoaded()) {
- loadActionsCache(security);
+ loadActionsCache(security, token);
}
if (cache.hasLoadingFailed()) {
Uri u = security.namespace.getUri(token, uri);
1.53 +6 -6 jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java
Index: StructureImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- StructureImpl.java 26 Oct 2004 21:09:29 -0000 1.52
+++ StructureImpl.java 27 Oct 2004 08:29:00 -0000 1.53
@@ -230,7 +230,7 @@
// Note : courUri still IS the Uri of the link, and so,
// in a way courUri is the parent of linkedUri.
Uri linkedUri = namespace
- .getUri(((LinkNode) courObject).getLinkedUri());
+ .getUri(token, ((LinkNode) courObject).getLinkedUri());
// 6 - We replace the courUri scope in the original uri
String courStrUri = courUri.toString();
@@ -387,7 +387,7 @@
// Note : courUri still IS the Uri of the link, and so,
// in a way courUri is the parent of linkedUri.
Uri linkedUri = namespace
- .getUri(((LinkNode) courObject).getLinkedUri());
+ .getUri(token, ((LinkNode) courObject).getLinkedUri());
// 6 - We replace the courUri scope in the original uri
String courStrUri = courUri.toString();
1.82 +4 -4 jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java
Index: PropertyHelper.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- PropertyHelper.java 1 Sep 2004 10:34:48 -0000 1.81
+++ PropertyHelper.java 27 Oct 2004 08:29:00 -0000 1.82
@@ -1532,7 +1532,7 @@
* @throws JDOMException
*/
public XMLValue computeSupportedPrivilegeSet(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String slideContextPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
- Map actionAggregation = ((SecurityImpl)nsaToken.getSecurityHelper()).getActionAggregation();
+ Map actionAggregation = ((SecurityImpl)nsaToken.getSecurityHelper()).getActionAggregation(sToken);
Set rootSet = new HashSet(actionAggregation.keySet());
Iterator actions = actionAggregation.keySet().iterator();
while (actions.hasNext()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org