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

Deleting Roles

Deleting Roles

The Backend Services RESTful API allows you to delete an existing role using an HTTP request. The operation requires Master Key authentication.

Use any of the following operations to delete roles:

Deleting a role deletes all permissions granted to the role over content types, content type items, or Business Logic items.

You cannot delete the application's default role not can you delete roles that have users assigned to them.

All operations require Master Kay authorization.

Deleting a Role by ID

To delete a role by ID:

//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/project-id/Roles/item-id',
    type: "DELETE",
    headers: {"Authorization" : "Masterkey your-master-key"},
    success: function(data){
        alert("Role was deleted successfully");
    },
    error: function(error){
        alert(error.message);
    }
});
Request:
    DELETE https://api.everlive.com/v1/Metadata/Applications/project-id/Roles/item-id
Headers:
    Authorization  Masterkey your-master-key
Response:
    Status: 200 OK
    Content-Type: application/json

On success, you receive the following response:

STATUS 200 OK
{
    "Result": 1
}

Deleting All Roles

To delete all roles, use the Roles endpoint without additional parameters:

//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/project-id/Roles',
    type: "DELETE",
    headers: {"Authorization" : "Masterkey your-master-key"},
    success: function(data){
        alert("Roles deleted successfully");
    },
    error: function(error){
        alert(error.message);
    }
Request:
    DELETE https://api.everlive.com/v1/Metadata/Applications/project-id/Roles
Headers:
    Authorization  Masterkey your-master-key
Response:
    Status: 200 OK
    Content-Type: application/json

On success, you receive the following response, where Result contains the number of deleted roles:

STATUS 200 OK
{
    "Result": 3
}

Deleting Roles by Filter

To delete a role by filter, use the Roles endpoint and specify a filter expression (see Introduction to Querying for details):

var filter = {
    "Name": "CommonUser"
};

$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/application-id-here/Roles',
    type: "DELETE",
    headers: {
        "Authorization": "Masterkey your-master-key-here",
        "X-Everlive-Filter": JSON.stringify(filter)
    },
    success: function(data) {
        alert("Role was deleted successfully");
    },
    error: function(error) {
        alert(error.message);
    }
});
Request:
    DELETE https://api.everlive.com/v1/Metadata/Applications/project-id/Roles
Headers:
    Authorization  Masterkey your-master-key
Response:
    Status: 200 OK
    Content-Type: application/json

On success, you receive the following response:

STATUS 200 OK
{
    "Result": 1
}

See Also

Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.