You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Xiaohua Lu (JIRA)" <ji...@apache.org> on 2007/03/14 21:35:09 UTC

[jira] Created: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

after enabling access manager, I can't createNode and setProperty without a node.save in the middle
---------------------------------------------------------------------------------------------------

                 Key: JCR-792
                 URL: https://issues.apache.org/jira/browse/JCR-792
             Project: Jackrabbit
          Issue Type: Bug
          Components: security
    Affects Versions: 1.2.3
            Reporter: Xiaohua Lu


I added my own access manager. after that I can't get the following code working 

Node n = createNewNode(parentNode);
n.setProperty();
parentNode.save();

It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg resolved JCR-792.
-----------------------------------

    Resolution: Fixed

the issue has been fixed as a side-effect of fixing JCR-689.

> after enabling access manager, I can't createNode and setProperty without a node.save in the middle
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JCR-792
>                 URL: https://issues.apache.org/jira/browse/JCR-792
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 1.2.3
>            Reporter: Xiaohua Lu
>         Assigned To: Stefan Guggisberg
>         Attachments: jaas.config, JackrabbitTest.java, ntExts.txt, TestAccessManager.java, TestLoginManager.java
>
>
> I added my own access manager. after that I can't get the following code working 
> Node n = createNewNode(parentNode);
> n.setProperty();
> parentNode.save();
> It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

Posted by "Xiaohua Lu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiaohua Lu reopened JCR-792:
----------------------------


please try the provided test code. 

> after enabling access manager, I can't createNode and setProperty without a node.save in the middle
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JCR-792
>                 URL: https://issues.apache.org/jira/browse/JCR-792
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 1.2.3
>            Reporter: Xiaohua Lu
>         Attachments: jaas.config, JackrabbitTest.java, ntExts.txt, TestAccessManager.java, TestLoginManager.java
>
>
> I added my own access manager. after that I can't get the following code working 
> Node n = createNewNode(parentNode);
> n.setProperty();
> parentNode.save();
> It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg resolved JCR-792.
-----------------------------------

    Resolution: Cannot Reproduce

i am unfortunately unable to reproduce the issue you're describing.

here's what i did trying to reproduce it:

i added the following lines at the beginning of the
SimpleAccessManager#isGranted(ItemId, int) method:

       try {
           String path = PathFormat.format(hierMgr.getPath(id), nsResolver);
           System.out.println("checking permission on " + path);
       } catch (RepositoryException re) {
           re.printStackTrace(System.out);
       } catch (NameException ne) {
           // erm
       }

when i run the following code:

           Node foo = root.addNode("foo");
           foo.setProperty("bar", "blah blah");
           root.save();

i get the following console output:

checking permission on /
checking permission on /foo/bar
checking permission on /foo/jcr:primaryType

so everything seems to be working as expected. note that i
used the hierarchy manager passed in the AMContext object
on init() for resolving the paths. 

feel free to reopen this issue if you don't agree. however, 
you should provide detailed instructions how to reproduce
it, ideally by providing  a simple test case.

> after enabling access manager, I can't createNode and setProperty without a node.save in the middle
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JCR-792
>                 URL: https://issues.apache.org/jira/browse/JCR-792
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 1.2.3
>            Reporter: Xiaohua Lu
>
> I added my own access manager. after that I can't get the following code working 
> Node n = createNewNode(parentNode);
> n.setProperty();
> parentNode.save();
> It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-792:
------------------------------

        Fix Version/s: 1.3
    Affects Version/s: 0.9
                       1.0
                       1.0.1
                       1.1
                       1.1.1
                       1.2.1
                       1.2.2

> after enabling access manager, I can't createNode and setProperty without a node.save in the middle
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JCR-792
>                 URL: https://issues.apache.org/jira/browse/JCR-792
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.9, 1.0, 1.0.1, 1.1, 1.1.1, 1.2.1, 1.2.2, 1.2.3
>            Reporter: Xiaohua Lu
>         Assigned To: Stefan Guggisberg
>             Fix For: 1.3
>
>         Attachments: jaas.config, JackrabbitTest.java, ntExts.txt, TestAccessManager.java, TestLoginManager.java
>
>
> I added my own access manager. after that I can't get the following code working 
> Node n = createNewNode(parentNode);
> n.setProperty();
> parentNode.save();
> It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

Posted by "Xiaohua Lu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiaohua Lu updated JCR-792:
---------------------------

    Attachment: jaas.config
                ntExts.txt
                JackrabbitTest.java
                TestAccessManager.java
                TestLoginManager.java

Hi Stefan, 

I have composed a test case and hopefully it will be helpful. But conceptually, if one session has node and property set, before commit, the other session should not see it, or am I wrong? (my implemenation of access manager is using another session compared to the test code)

step to reproduce :
1. copy the file to a directory 
2. copy required jar files to lib directory 
3. compile the code and run  JackrabbitTest 

Let me know how it goes.

Thanks.

Xiaohua 










> after enabling access manager, I can't createNode and setProperty without a node.save in the middle
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JCR-792
>                 URL: https://issues.apache.org/jira/browse/JCR-792
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 1.2.3
>            Reporter: Xiaohua Lu
>         Attachments: jaas.config, JackrabbitTest.java, ntExts.txt, TestAccessManager.java, TestLoginManager.java
>
>
> I added my own access manager. after that I can't get the following code working 
> Node n = createNewNode(parentNode);
> n.setProperty();
> parentNode.save();
> It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg reopened JCR-792:
-----------------------------------


reopening as i am now able to reproduce the issue

> after enabling access manager, I can't createNode and setProperty without a node.save in the middle
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JCR-792
>                 URL: https://issues.apache.org/jira/browse/JCR-792
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 1.2.3
>            Reporter: Xiaohua Lu
>         Attachments: jaas.config, JackrabbitTest.java, ntExts.txt, TestAccessManager.java, TestLoginManager.java
>
>
> I added my own access manager. after that I can't get the following code working 
> Node n = createNewNode(parentNode);
> n.setProperty();
> parentNode.save();
> It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg reassigned JCR-792:
-------------------------------------

    Assignee: Stefan Guggisberg

> after enabling access manager, I can't createNode and setProperty without a node.save in the middle
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JCR-792
>                 URL: https://issues.apache.org/jira/browse/JCR-792
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 1.2.3
>            Reporter: Xiaohua Lu
>         Assigned To: Stefan Guggisberg
>         Attachments: jaas.config, JackrabbitTest.java, ntExts.txt, TestAccessManager.java, TestLoginManager.java
>
>
> I added my own access manager. after that I can't get the following code working 
> Node n = createNewNode(parentNode);
> n.setProperty();
> parentNode.save();
> It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-792) after enabling access manager, I can't createNode and setProperty without a node.save in the middle

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg resolved JCR-792.
-----------------------------------

    Resolution: Invalid

i ran your test code (against svn trunk). here's the console output:

freshDB true
checking permission on /
checking permission on /
checking permission on /newNode/jcr:primaryType
checking permission on /newNode/ext:name
checking permission on /newNode/jcr:uuid

so everything seems to be working as expected....

please note that the access manager will be invoked 
*before* the changes are actually committed,
i.e. new nodes and properties are not yet visible
to other sessions.

> after enabling access manager, I can't createNode and setProperty without a node.save in the middle
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JCR-792
>                 URL: https://issues.apache.org/jira/browse/JCR-792
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 1.2.3
>            Reporter: Xiaohua Lu
>         Attachments: jaas.config, JackrabbitTest.java, ntExts.txt, TestAccessManager.java, TestLoginManager.java
>
>
> I added my own access manager. after that I can't get the following code working 
> Node n = createNewNode(parentNode);
> n.setProperty();
> parentNode.save();
> It seems that setProperty will invoke access control check, but since the new node is not in the repository yet, my access manager implementation won't be able to grant permission. I also tried to use hierachyManager to get the path of the new node, it also returned null. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.