MindTouch Developer Center > MindTouch Deki > API Reference > POST:users/{userid}/allowed

Overview

public. Check one or more resources if given operation is allowed.

Uri Parameters
NameTypeDescription
useridstringeither an integer user ID, "current", or "=" followed by a double uri-encoded user name
Query Parameters
NameTypeDescription
masklong?Permission bit mask required for the pages
operationsstring?Comma separated list of operations to verify
Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body
NotFound404Requested user could not be found
Ok200The request completed successfully

Message Format

Input:

<pages>
    <page id="{int}"/>
    ...
</pages>

Output:

<pages>
    <page id="{int}" href="{uri}">
        <title>{text}</title>
        <path>{text}</path>
    </page>
    ...
</pages>

Implementation Notes

Use GET:site/operations to retrieve a list of all operations currently defined on the site.

Code Samples

The following code example checks whether the Anonymous user has LOGIN and READ access to pages with ID 29 and 31:

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
XDoc pagesDoc = new XDoc("pages")
    .Start("page")
        .Attr("id", 29)
    .End()
    .Start("page")
        .Attr("id", 31)
    .End();
p.At("users", "=Anonymous", "allowed").With("operations", "LOGIN,READ").Post(pagesDoc);

Sample response that indicates the Anonymous user has LOGIN and READ access to the page with ID 29, but not to the page with ID 31:

<pages>
    <page id="29" href="http://deki-hayes/@api/deki/pages/29">
        <title>DekiWiki (Hayes)</title> 
        <path /> 
    </page>
</pages>
Tag page
You must login to post a comment.