Was this page helpful?

PUT:pages/{pageid}/security

    Overview

    public. Set page security info

    Uri Parameters
    NameTypeDescription
    pageidstringeither an integer page ID, "home", or "=" followed by a double uri-encoded page title
    Query Parameters
    NameTypeDescription
    authenticatebool?Force authentication for request (default: false)
    cascade{none,delta,absolute}?none: Permissions are not cascaded to child pages; deltas: Changes between given page's security and proposed security cascaded to child nodes; absolute: Proposed security is set on child pages. Default: none
    redirectsint?If zero, do not follow page redirects.
    Return Codes
    NameValueDescription
    BadRequest400Invalid input parameter or request body
    Forbidden403Change permissions access to the page is required
    NotFound404Requested page could not be found
    Ok200The request completed successfully

    Message Format

    Input:

    <security>
        <permissions.page>
            <restriction>{text}</restriction> 
        </permissions.page>
        <grants>
            <grant>
                <permissions>
                    <role>{text}</role> 
                </permissions>
                <user id="{int}"></user>
                <date.expires>{date}</date.expires> 
            </grant>
            <grant>
                <permissions>
                    <role>{text}</role> 
                </permissions>
                <group id="{int}"></group>
                <date.expires>{date}</date.expires> 
            </grant>
            ...
        </grants>
    </security>

    Output:

    <security href="{uri}">
        <permissions.effective>
            <operations mask="{int}">{text}</operations> 
        </permissions.effective>
        <permissions.page>
            <operations mask="{int}">{text}</operations> 
            <restriction>{text}</restriction> 
        </permissions.page>
        <grants>
            <grant>
                <permissions>
                    <operations mask="{int}">{text}</operations> 
                    <role id="{int}" href="{uri}">{text}</role> 
                </permissions>
                <user id="{int}" href="{uri}">
                    <nick>{text}</nick> 
                    <username>{text}</username> 
                    <email>{text}</email> 
                </user>
                <date.expires>{date}</date.expires> 
                <date.modified>{date}</date.modified> 
                <user.modifiedby id="{int}" href="{uri}">
                    <nick>{text}</nick> 
                    <username>{text}</username> 
                    <email>{text}</email> 
                </user.modifiedby>
            </grant>
            <grant>
                <permissions>
                    <operations mask="{int}">{text}</operations> 
                    <role id="{int}" href="{uri}">{text}</role> 
                </permissions>
                <group id="{int}" href="{uri}">
                    <name>{text}</name> 
                </group>
                <date.expires>{date}</date.expires> 
                <date.modified>{date}</date.modified> 
                <user.modifiedby id="{int}" href="{uri}">
                    <nick>{text}</nick> 
                    <username>{text}</username> 
                    <email>{text}</email> 
                </user.modifiedby>
            </grant>
            ...
        </grants>
    </security>

    Implementation Notes

    The permissions.page element sets the page restriction.  The grants section replaces all existing grants on the page.  Use POST:pages/{pageid}/security to add or remove particular grants.

    Currently defined page restrictions are:

    • Public: All users can read and edit
    • Semi-Public: All users can read, but only selected users can edit
    • Private: Only selected users can read and edit

    Use GET:site/roles to retrieve a list of roles currently defined for the site.

    Code Samples

    C# Samples

     

    Curl Samples

     

    PHP Samples

     

    Other Code Samples

     

    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by