Role

View as Markdown

Role

A Role is a collection of permissions that applies to all the users who are assigned to it. Using Roles, you can assign permissions to a group of users rather than assigning permissions individually.

Create

The Create request creates a new role in a stack.

NameTypeDescription
model (required)RoleModel

Role Model for creating Role.

collectionParameterCollection

Query parameter collection.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

RoleModel model = new RoleModel(); 

ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Role("<ROLE_UID>").Create(model);

CreateAsync

The Create request creates a new role in a stack.

NameTypeDescription
model (required)RoleModel

Role Model for creating Role.

collectionParameterCollection

Query parameter collection.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

RoleModel model = new RoleModel(); 

ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").CreateAsync(model);

Delete

The Delete call deletes an existing role from your stack

NameTypeDescription
collectionParameterCollection

Query parameter collection.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").Delete();

DeleteAsync

The Delete call deletes an existing role from your stack

NameTypeDescription
collectionParameterCollection

Query parameter collection.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").DeleteAsync();

Fetch

The Fetch request returns comprehensive information on a specific role.

NameTypeDescription
collectionParameterCollection

Query parameter collection.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Role("<ROLE_UID>").Fetch();

FetchAsync

The Fetch request returns comprehensive information on a specific role.

NameTypeDescription
collectionParameterCollection

Query parameter collection.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").FetchAsync();

Query

The Query on Role request returns comprehensive information about all roles created in a stack.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

Query query = client.Stack("<API_KEY>").Role().Query();

Update

The Update request creates a new role in a stack.

NameTypeDescription
model (required)RoleModel

Role Model for creating Role.

collectionParameterCollection

Query parameter collection.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

RoleModel model = new RoleModel(); 

ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Role("<ROLE_UID>").UpdateAsync(model);

UpdateAsync

The Update request creates a new role in a stack.

NameTypeDescription
model (required)RoleModel

Role Model for creating Role.

collectionParameterCollection

Query parameter collection.

using Contentstack.Management.Core;

using Contentstack.Management.Core.Models;


ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

RoleModel model = new RoleModel(); 

ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").UpdateAsync(model);

Rules

Base class for all rules in stack.

NameTypeDescription
ACLString

ACL for the rule

Restrictboolean

Set true to restrict rule.

AssetRules

Rules for setting on Assets.

NameTypeDescription
AssetsList<string>

List of asset for adding into rule.

ModuleString

Modules for the rules to be applied.

BranchAliasRules

Rules for setting on branch alias.

NameTypeDescription
BranchAliasList<string>

List of branch alias for adding into rule.

Modulestring

Modules for the rules to be applied.

BranchRules

Rules for setting on branch.

NameTypeDescription
BranchesList<string>

List of branch for adding into rule.

Modulestring

Modules for the rules to be applied.

ContentTypeRules

Rules for setting on content type.

NameTypeDescription
ContentTypesList<string>

List of content types for adding into rule.

Modulestring

Modules for the rules to be applied.

EnvironmentRules

Rules for setting on environment.

NameTypeDescription
EnvironmentsList<string>

List of environments for adding into rule.

Modulestring

Modules for the rules to be applied.

FolderRules

Rules for setting on folders.

NameTypeDescription
FoldersList<string>

List of folders for adding into rule.

Modulestring

Modules for the rules to be applied.

FieldRules

Rule for the field in content type.

NameTypeDescription
ActionsList<Action>

List of action for the field rules.

conditionsList<Condition>

List of conditions for the field rules.

MatchTypestring

Match type for the field.

TaxonomyRules

Rule for the field in taxonomy.

NameTypeDescription
TaxonomiesList<string>

List of Taxonomies for adding into rule

TermsList<strings>

List of Terms for adding into rule.

ContentTypesList<TaxonomyContentType>

List of TaxonomyContentType for adding into this rule