getControlSecurity()

Pixelsilk API function to get the security options for a control--requires the advanced-admin-access permission
Parameters:
controlId: the unique identifier of the control

Output:
The function getControlSecurity returns a string containing the security options for the control

C# Example:
Guid controlId = <control's id>;
string securityOptions = GetControlSecurity(controlId);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/getControlSecurity HTTP/1.1
HOST: www.example.com
Content-Length: 123
Content-Type: application/x-www-form-urlencoded
Cookie: auth=492178CA49C1...21B0988967FE

Request Data:
Unencoded Data:
json={
   "controlId":"d83198a3-1e97-4d4c-b9d6-3b78d4649f43"
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
json=%7b%0d%0a+++...%22%0d%0a%7d&token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=7BE5D25D1570...1ED5C101DDB; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 852

Response Data:
[{"id":"28702460-372d-4815-a594-92b9864b1085","role":"Administrators","permissions":["edit-webbox","view-webbox"]},{"id":"b69a7b39-7d88-47bf-835c-2baf14781aaa","role":"Everyone","permissions":["view-webbox"]}]

JavaScript Example:
Method Call:
pixelsilk2.getControlSecurity(input, callback)

Input Object:
{
    controlId:"5e591461-bff5-4bbb-ae49-450a1617221b"
}

Returned Data:
[
    {
        "id":"28702460-372d-4815-a594-92b9864b1085",
        "role":"Administrators",
        "permissions":[
        ]
    },
    {
        "id":"728a9c66-9c50-49a7-a260-501d1ac62763",
        "role":"Ed",
        "permissions":[
        ]
    },
    {
        "id":"b69a7b39-7d88-47bf-835c-2baf14781aaa",
        "role":"Everyone",
        "permissions":[
        ]
    },
    {
        "id":"4a364070-b45a-4e18-9587-ff65b941e401",
        "role":"SecurityTest",
        "permissions":[
        ]
    }
]
NOTE: Many control security objects were removed to make this easier to read.

Back to Controls »