Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hello Ka,

Above command works for me.

Yogesh

View solution in original post

6 Replies

Avatar

Level 10

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

Avatar

Level 2

Thanks for your reply

So are there anyway to modify permission using cURL command?

Avatar

Level 2

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

Avatar

Correct answer by
Level 5

Hello Ka,

Above command works for me.

Yogesh

Avatar

Level 2

Hi Yogesh

 

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

Many thanks