I have made the following correction in the file SecurityImpl.java

It works now but please tell me if u think it's right.



public boolean matchPrincipal(SlideToken token, SubjectNode checkSubject, 
SubjectNode matchSubject, int level) throws ServiceAccessException {
        if (matchSubject.equals(checkSubject)) {
            return true;
        }
        else {
                System.out.println("security impl, matchPrincipal, subject = " 
+ matchSubject.getUri());
            Uri groupUri = namespace.getUri(token, matchSubject.getUri());
            try {
                NodeRevisionDescriptor nrd =
                    groupUri.getStore().retrieveRevisionDescriptor(groupUri, 
new NodeRevisionNumber());
                NodeProperty membersetProp = 
nrd.getProperty("group-member-set");
                if (membersetProp != null && membersetProp.getValue() != null) {
                    XMLValue xmlVal = new 
XMLValue((String)membersetProp.getValue());
                    List memberNodes = xmlVal.getHrefNodes();
                    if (memberNodes.contains(checkSubject)) {
                        return true;
                    }
                    else if (level > 0) {
                        int nextLevel = level - 1;
                        boolean match = false;
                        Iterator i = memberNodes.iterator();
                        while (!match && i.hasNext()) {
                            SubjectNode nextMatchNode = (SubjectNode)i.next();
                            if (namespaceConfig.isRole(nextMatchNode.getUri())
                                || 
namespaceConfig.isGroup(nextMatchNode.getUri())) {
                                

/*************************** ADDED ******************************/
                                
try {
                                                        
nextMatchNode.setUri(URLDecoder.decode(nextMatchNode.getUri(),"UTF8");
} catch (UnsupportedEncodingException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
}
/*************************** END ADDED ******************************/          
                


match = matchPrincipal(token, checkSubject, nextMatchNode, nextLevel);
                            }
                        }
                        return match;
                    }
                    else {
                        return false;
                    }
                }
                else {
                    return false;
                }
            }
            catch (RevisionDescriptorNotFoundException e) {
                return false;
            }
            catch (ServiceAccessException e) {
                throw e;
            }
            catch (JDOMException e) {
                e.printStackTrace();
                return false;
            }
        }
    }



-----Message d'origine-----
De : Laurent Michenaud [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 27 janvier 2006 18:42
À : Slide Users Mailing List
Objet : Bugs with role inside role ?

Hi,

 

I try to integrate a role A inside a role B.

The role A name contains spaces.

I use the binding store.

 

The role A name : Administratif et corrompu

 

In the role B store file, I've got :

 

<property name="group-member-set" namespace="DAV:" value="&lt;D:href
xmlns:D=&quot;DAV:&quot;&gt;/roles/Administratif%20et%20corrompu&lt;/D:h
ref&gt;" type="" protected="false">

 

 

When I try to browse the roles directory, I get :

 

TP-Processor3, 27-janv.-2006 18:34:19, root, GET, 500 "Internal Server
Error", 31 ms, /roles

 

If I stop the slide server, then I edit the role B file, I replace %20
with spaces, I restart the server, 

then It works again.

 

 

One more thing :

 

I try to integrate a user C inside the role B.

The user C name contains spaces.

Spaces are also replaced with %20 in the role B store file.

But it is working and there is no error.

 

 

So, I think a treatment is missing for role inside role..

 

Another question : how can I have more logs about slide ?

 

Please help...

Thanks...

 

 

 

 

 

 

 

 

 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to