updateRole()

Pixelsilk API function to edit a role--requires the access-users permission
Parameters:
hiddenName: the hidden name of the role
name: the name of the role
description: the description of the role
isHidden: true = hidden; false = not hidden
isSystemRole: true = is system role; false = is not system role
adminAccess: the collection of permissions for the role

Output:
The function updateRole returns void.

C# Example:
string hiddenName = "hiddenNameOfRole";
string name = "nameOfRole";
string description = "descriptionOfRole";
string isHidden = "false";
string isSystemRole = "false";
string[] adminAccess = {"advanced-admin-access", "access-libraries"};
UpdateRole(hiddenName, name, description, isHidden, isSystemRole, adminAccess);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/updateRole HTTP/1.1
HOST: www.example.com
Content-Length: 392
Content-Type: application/x-www-form-urlencoded
Cookie: auth=4A2105785672...85BC493A8733

Request Data:
Unencoded Data:
json={
   "hiddenName":"Exemplar",
   "name":"Exemplar",
   "description":"example role",
   "isHidden":"false",
   "isSystemRole":"false",
   "adminAccess":[
      "advanced-admin-access",
      "access-libraries"
   ]
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

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

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=7C3329E56D19...92A5AA23168; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 2

Response Data:
{}

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

Input Object:
{
    hiddenName:"Oscar",
    name:"Oscar",
    description:"search engine optimizer",
    isHidden:"false",
    isSystemRole:"false",
    adminAccess:[
        "edit-page-properties",
        "add-skin",
        "edit-skin",
        "delete-skin",
        "add-search-advice",
        "edit-search-advice",
        "view-search-advice"
    ]
}

Returned Data:
{}

Back to Users »