Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

updaterolepagepermission not working as expected

PremRajani
Collaborator II

I'm trying to update page permission for all roles using SOAP API and it says 505 error. Not sure if I'm doing something wrong.

            string soapActionString = "UpdateRolePagePermissions2";
            string falseString = "false";
            string trueString = "true";
            int pageId = 257;

            StringBuilder bodyBuilder = new StringBuilder();
            bodyBuilder.Append("<" + soapActionString + " xmlns=\"http://archer-tech.com/webservices/\">");
            bodyBuilder.Append("<sessionToken>" + internalSession + "</sessionToken>");
            bodyBuilder.Append("<roleId>" + roleId + "</roleId>");
            bodyBuilder.Append("<pageId>" + pageId + "</pageId>");
            bodyBuilder.Append("<create>" + falseString + "</create>");
            bodyBuilder.Append("<read>" + trueString + "</read>");
            bodyBuilder.Append("<update>" + falseString + "</update>");
            bodyBuilder.Append("<delete>" + falseString + "</delete>");
            bodyBuilder.Append("</" + soapActionString + ">");

            string rolePermissionsResult = CommonMethod(archerUri + roleLink, soapActionString, bodyBuilder.ToString());

Tried both boolean and string but doesn't work. After 6.12 upgrade we need to update Reports Listing to default 'read' only for all roles.

Thanks,

Prem

1 REPLY 1

MarkPrivratsky
Contributor III

I've never had luck getting the SOAP Update Role Permission API to work.   I have used the REST API to successfully update role permissions.  

/platformapi/core/system/role

$requestBody = @"
{
"AccessRole": {
"ID":$RoleID,
"Alias":"$RoleAlias",
"Name":"$RoleName",
"Description":"$RoleDesc"
},
"AccessRoleTasks": [
{
"TaskId":$RolePageID,
"HasCreate":"$RoleCreate",
"HasRead":"$RoleRead",
"HasUpdate":"$RoleUpdate",
"HasDelete":"$RoleDelete"
}
]
}
"@