Issue Details (XML | Word | Printable)

Key: SEC-597
Type: Improvement Improvement
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Ben Alex
Reporter: Emanuel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Security

AclImpl.setParent() throws Exception when changing parent to null

Created: 07/Nov/07 03:19 PM   Updated: 14/Apr/08 01:42 AM
Component/s: ACLs
Affects Version/s: 1.0.5
Fix Version/s: 2.0.0

Time Tracking:
Not Specified

Issue Links:
Duplicate
 


 Description  « Hide
I think it should be possible to change the parent of a directory to null:

Sample Scenario:
Filebrowser that manages a directory structure (the directories are secured by acegi). Now i want to move a nested directory to Root-Level. The parent-property of the corresponding ACL has to be changed to NULL.

Solution:
Simply change:

    public void setParent(Acl newParent) {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
        Assert.notNull(newParent, "New Parent required");
        Assert.isTrue(!newParent.equals(this), "Cannot be the parent of yourself");
        this.parentAcl = newParent;
    }

to

    public void setParent(Acl newParent) {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
        Assert.isTrue(newParent == null || !newParent.equals(this), "Cannot be the parent of yourself");
        this.parentAcl = newParent;
    }



 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.