POST api/Role

Creates a new Role.



Request Information

URI Parameters

None.



Body Parameters

The CreateRoleViewModel representing the Role to create.

CreateRoleViewModel
NameDescriptionTypeAdditional information
RoleName

string

None.

RolePermissions

Collection of SaveRolePermissionViewModel

None.

Request Formats

application/json, text/json

Sample:
{
  "RoleName": "sample string 1",
  "RolePermissions": [
    {
      "EntityDefinitionId": 1,
      "EntityCategoryId": 1,
      "EntityAttributeId": 1,
      "FileDirectoryId": 1,
      "PermissionId": 1
    },
    {
      "EntityDefinitionId": 1,
      "EntityCategoryId": 1,
      "EntityAttributeId": 1,
      "FileDirectoryId": 1,
      "PermissionId": 1
    }
  ]
}

application/xml, text/xml

Sample:
<CreateRoleViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/VobeSoft.Models.ViewModels">
  <RoleName>sample string 1</RoleName>
  <RolePermissions>
    <SaveRolePermissionViewModel>
      <EntityAttributeId>1</EntityAttributeId>
      <EntityCategoryId>1</EntityCategoryId>
      <EntityDefinitionId>1</EntityDefinitionId>
      <FileDirectoryId>1</FileDirectoryId>
      <PermissionId>1</PermissionId>
    </SaveRolePermissionViewModel>
    <SaveRolePermissionViewModel>
      <EntityAttributeId>1</EntityAttributeId>
      <EntityCategoryId>1</EntityCategoryId>
      <EntityDefinitionId>1</EntityDefinitionId>
      <FileDirectoryId>1</FileDirectoryId>
      <PermissionId>1</PermissionId>
    </SaveRolePermissionViewModel>
  </RolePermissions>
</CreateRoleViewModel>

application/x-www-form-urlencoded

Sample:

Sample not available.



Response Information

Resource Description

ReadRoleViewModel

NameDescriptionTypeAdditional information
ApplicationId

globally unique identifier

None.

Description

string

None.

IsUsed

boolean

None.

LoweredRoleName

string

None.

RoleId

globally unique identifier

None.

RoleName

string

None.

RolePermissions

Collection of ReadRolePermissionViewModel

None.

UserCompanyId

integer

None.

Response Formats

application/json, text/json

Sample:
{
  "ApplicationId": "ff488405-4d36-46cb-bcbb-89cc2448df89",
  "Description": "sample string 2",
  "IsUsed": true,
  "LoweredRoleName": "sample string 4",
  "RoleId": "61b46037-9289-430d-abcc-b8c300a52479",
  "RoleName": "sample string 6",
  "RolePermissions": [
    {
      "Id": 1,
      "RoleId": "9e7e7f8e-94f5-401c-b3ec-f61ad8fb9e23",
      "EntityDefinitionId": 1,
      "EntityCategoryId": 1,
      "EntityAttributeId": 1,
      "FileDirectoryId": 1,
      "PermissionId": 3
    },
    {
      "Id": 1,
      "RoleId": "9e7e7f8e-94f5-401c-b3ec-f61ad8fb9e23",
      "EntityDefinitionId": 1,
      "EntityCategoryId": 1,
      "EntityAttributeId": 1,
      "FileDirectoryId": 1,
      "PermissionId": 3
    }
  ],
  "UserCompanyId": 1
}

application/xml, text/xml

Sample:
<ReadRoleViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/VobeSoft.Models.ViewModels">
  <ApplicationId>ff488405-4d36-46cb-bcbb-89cc2448df89</ApplicationId>
  <Description>sample string 2</Description>
  <IsUsed>true</IsUsed>
  <LoweredRoleName>sample string 4</LoweredRoleName>
  <RoleId>61b46037-9289-430d-abcc-b8c300a52479</RoleId>
  <RoleName>sample string 6</RoleName>
  <RolePermissions>
    <ReadRolePermissionViewModel>
      <EntityAttributeId>1</EntityAttributeId>
      <EntityCategoryId>1</EntityCategoryId>
      <EntityDefinitionId>1</EntityDefinitionId>
      <FileDirectoryId>1</FileDirectoryId>
      <Id>1</Id>
      <PermissionId>3</PermissionId>
      <RoleId>9e7e7f8e-94f5-401c-b3ec-f61ad8fb9e23</RoleId>
    </ReadRolePermissionViewModel>
    <ReadRolePermissionViewModel>
      <EntityAttributeId>1</EntityAttributeId>
      <EntityCategoryId>1</EntityCategoryId>
      <EntityDefinitionId>1</EntityDefinitionId>
      <FileDirectoryId>1</FileDirectoryId>
      <Id>1</Id>
      <PermissionId>3</PermissionId>
      <RoleId>9e7e7f8e-94f5-401c-b3ec-f61ad8fb9e23</RoleId>
    </ReadRolePermissionViewModel>
  </RolePermissions>
  <UserCompanyId>1</UserCompanyId>
</ReadRoleViewModel>