Creating Roles

Creating Roles

The Backend Services .NET SDK allows you to create roles from any .NET based application. The operation requires Master Key authentication.

You can create a single role at a time using the .NET SDK.

To create a new role for the application, execute the following code snippet:

public async Task<CreateResultItem> CreateRoleAsync(Guid applicationId, Role newRole, string masterKey)
{
    var metadata = new EverliveAccount(new EverliveAccountSettings(AuthorizationStrategy.MasterKey, masterKey));
    return await metadata.WorkWith().Application(applicationId).Roles().Create(newRole).ExecuteAsync();
}

After creating the role, the server returns the ID of the created item along with its creation date:

STATUS 201 Created
{
    "Result": {
        "Id": "4839eb70-23e0-11e5-8f10-7192c7d7169d",
        "CreatedAt": "2015-07-06T13:09:49.607Z"
    }
}

See Also

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