Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Changing a Content Type's Security Policy

Changing a Content Type's Security Policy

When you don't need role-based permissions, you can use the Backend Services RESTful API to set a content type's security policy.

To change the security policy of a type you can make a request to the /Security endpoint for the type. This example sets the security policy to 1 which stands for Private (see the table below the code snippet for other values):

var updateObject = {
    SecurityPolicy: 1
};
$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-name/Security'
    type: "PUT",
    headers: { "Authorization" : "Masterkey your-master-key" },
    data: JSON.stringify(updateObject),
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});
Request:
    PUT https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-name/Security
Headers:
    Authorization  Masterkey your-master-key
Payload - raw:
     {
        SecurityPolicy: 1
    }
Response:
    Status: 200 OK
    Content-Type: application/json

The following table lists the possible values for the SecurityPolicy parameter:

SecurityPolicy Value Permission
1 Private (read yours, write yours)
2 Shared (read all, write yours)
3 Public (read all, write all)
4 Read-only (read all, write none)
10 Custom (corresponds to role-based permissions*)
*For setting a custom set of role-based permissions, see Introduction to Roles.
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.