how to change user permission using cURL command in CQ5.5? | Community
Skip to main content
Level 2
October 16, 2015
Solved

how to change user permission using cURL command in CQ5.5?

  • October 16, 2015
  • 6 replies
  • 3749 views

Hi

I search on google and i find the following command which said it can modify permission of a user (http://www.wemblog.com/2012/03/how-to-do-user-management-using-post.html)

curl -u admin:admin -FprincipalId=testuser -Fprivilege@jcr:all=granted http://localhost:4502/content.modifyAce.html

When I execute the command I get the following error:

<html>
<head>
    <title>Error while processing /content</title>
</head>
    <body>
    <h1>Error while processing /content</h1>
    <table>
        <tbody>
            <tr>
                <td>Status</td>
                <td><div id="Status">500</div></td>
            </tr>
            <tr>
                <td>Message</td>
                <td><div id="Message">javax.jcr.RepositoryException: Failed to resolve path privilege@jcr:all relative to node /content</div></td>
            </tr>
            <tr>
                <td>Location</td>
                <td><a href="https://forums.adobe.com/content" id="Location">/content</a></td>
            </tr>
            <tr>
                <td>Parent Location</td>
                <td><a href="https://forums.adobe.com/" id="ParentLocation">/</a></td>
            </tr>
            <tr>
                <td>Path</td>
                <td><div id="Path">/content</div></td>
            </tr>
            <tr>
                <td>Referer</td>
                <td><a href="" id="Referer"></a></td>
            </tr>
            <tr>
                <td>ChangeLog</td>
                <td><div id="ChangeLog">&lt;pre&gt;&lt;/pre&gt;</div></td>
            </tr>
        </tbody>
    </table>
    <p><a href="">Go Back</a></p>
    <p><a href="https://forums.adobe.com/content">Modified Resource</a></p>
    <p><a href="https://forums.adobe.com/">Parent of Modified Resource</a></p>
    </body>
</html>

 

Anyone have any suggestion?

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Yogesh_Upadhyay

Hello Ka,

Above command works for me.

Yogesh

6 replies

smacdonald2008
Level 10
October 16, 2015

That blog is owned by one of our AEM community members. I am hoping to hear from that member about this error. 

Level 2
October 16, 2015

Thanks for your reply

So are there anyway to modify permission using cURL command?

Yogesh_Upadhyay
Level 6
October 16, 2015

Hello,

As mentioned in blog please install http://mvnrepository.com/artifact/org.apache.sling/org.apache.sling.jcr.jackrabbit.accessmanager/2.1.0 first and then try.

Yogesh

Level 2
October 16, 2015

Thanks, it works after I installed the osgi bundle to my CQ instance

But can the POST API grant replicate permission of a node to a principal?

I tried the follow command:
curl -u admin:admin -FprincipalId=test_group -Fprivilege@crx:replicate=granted http://localhost:4502/content/geometrixx.modifyAce.html

But it returns 500 and the error msg as follow:

javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {}principalId

Please advice

Yogesh_Upadhyay
Yogesh_UpadhyayAccepted solution
Level 6
October 16, 2015

Hello Ka,

Above command works for me.

Yogesh

Level 2
October 16, 2015

Hi Yogesh

 

I made a typo when running the command before.  It works now

Many thanks