API Docs
HomeDocsWebsite
  • Home
  • Introduction
    • Authorization
      • Authorize
      • Get a Token
      • Third-Party Login
    • Field Types and Validation
      • Field Types
      • Validation
    • Query Manipulation
      • Constraints
      • Result Control
      • Value Filters
    • Entity Permissions
      • Restricted Scope
  • API reference
    • Infoboard
      • InfoboardChannels
      • InfoboardPosts
      • InfoboardPostSeenUsers
      • InfoboardPostReadUsers
      • InfoboardComments
      • InfoboardDepartmentSettings
    • Manual
      • ManualChapters
      • ManualEntries
      • ManualEntrySeenUsers
    • Calendar
      • Calendars
      • CalendarEvents
    • Filemanager
      • FilemanagerDirectories
      • FilemanagerFiles
    • Files
    • Forms
      • Forms
      • FormFields
      • FormFieldTypes
      • FormFieldValidations
      • FormFieldValidationTypes
      • FormMessages
      • FormMessageFields
    • Layouts
      • Layouts
      • LayoutRows
      • LayoutColumns
      • LayoutColumnLayoutElements
    • Tasks 2.0
      • TaskTemplates
      • TaskFields
      • TaskAssignments
      • TaskExecutions
      • TaskProgressFields
    • Departments
    • Roles
    • Permissions
    • Users
    • UserActivities
    • EntityPermissions
    • Notifications
    • Reactions
    • Icons
    • Folders
    • SharedItems
    • UrlContext
  • Resources
    • Release Notes
      • v2.106.0
      • v2.102.0
Powered by GitBook
On this page
  • Introduction
  • Model Definition
  • List
  • Show
  • Create
  • Update
  • Delete
  1. API reference

Roles

PreviousDepartmentsNextPermissions

Last updated 8 days ago

Introduction

Roles are used to manage Permissions in intratool.

The binding of Permissions to a Role is done by a pivot table called permission_role, in which each Permission of the unique Role is assigned.

Those Roles will then get assigned to a so that every member of a has the same Permissions.

Model Definition

Alias

role

Relations

Key
Relation
Type
Relation Field(s)

user

Belongs to

user_id

department

Belongs to

department_id

folder

Belongs to

folder_id

departments

Belongs to many

Intermediate table

infoboardDepartments

Belongs to many

Intermediate table

permissions

Belongs to many

Intermediate table

users

Has many

users.role_id

List

Get a list of all Roles.

Definition

GET /api/roles

Example Request

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/roles', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response

[
  {
    "id": 2,
    "name": "Standort 01",
    "active": true,
    "user_id": 2,
    "department_id": 2,
    "folder_id": null,
    "location_key": null,
    "sort_number": 2,
    "created_at": "2019-01-15 12:00:00",
    "updated_at": "2019-01-15 12:00:00",
    "deleted_at": null
  },
  {
    "id": 3,
    "name": "Standort 02",
    "active": true,
    "user_id": 2,
    "department_id": 3,
    "folder_id": null,
    "location_key": null,
    "sort_number": 3,
    "created_at": "2019-01-15 13:00:00",
    "updated_at": "2019-01-15 13:00:00",
    "deleted_at": null
  }
]

Show

Show a single Role by id.

Definition

GET /api/roles/{id}

Example Request

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/roles/2', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response

{
  "id": 2,
  "name": "Standort 01",
  "active": true,
  "user_id": 2,
  "department_id": 2,
  "folder_id": null,
  "location_key": null,
  "sort_number": 2,
  "created_at": "2019-01-15 12:00:00",
  "updated_at": "2019-01-15 12:00:00",
  "deleted_at": null
}

Create

Create a new Role.

Definition

POST /api/roles

Request Keys

Key
Type
Default
Description

department_id *

integer

-

name *

string

-

The name of the Role.

active

boolean

true

Whether the Role is active.

permissions_ids *

array

-

department_ids

array

Related Department

infoboard_department_ids

array

Related Department

folder_id

integer

-

location_key

string

-

The location description of the Role.

sort_number

integer

Current highest +1

Keys with * are required.

Example Request

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/roles', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'department_id' => 4,
        'name' => 'Standort 03',
        'permission_ids' => [1]
    ]
]);

Example Response

{
  "status": "success",
  "data": {
    "id": 4,
    "name": "Standort 03",
    "active": true,
    "user_id": 2,
    "department_id": 4,
    "folder_id": null,
    "location_key": null,
    "sort_number": 4,
    "created_at": "2019-01-15 14:00:00",
    "updated_at": "2019-01-15 14:00:00",
    "deleted_at": null
  }
}

Update

Update an existing Role by id.

Definition

PUT /api/roles/{id}

Request Keys

Key
Type
Description

department_id

integer

name

string

The name of the Role.

active

boolean

Whether the Role is active.

permissions_ids

array

department_ids

array

infoboard_department_ids

array

folder_id

integer

location_key

string

The location description of the Role.

sort_number

integer

Example Request

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/roles/4', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'department_ids' => [2, 3],
        'location_key' => 'Standort-03'
    ]
]);

Example Response

{
  "status": "success",
  "data": {
    "id": 4,
    "name": "Standort 03",
    "active": true,
    "user_id": 2,
    "department_id": 4,
    "folder_id": null,
    "location_key": "Standort-03",
    "sort_number": 4,
    "created_at": "2019-01-15 14:00:00",
    "updated_at": "2019-01-15 14:30:00",
    "deleted_at": null
  }
}

Delete

Delete an existing Role by id.

Definition

DELETE /api/roles/{id}

Example Request

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('DELETE', '/api/roles/4', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response

{
  "status": "success",
  "data": null
}

The ID of the the Role is assigned to.

The IDs of to grant the Role.

The IDs of the Role has "advanced access" to view content from.

The IDs of the Role is allowed to assign to.

The ID of the Role is assigned to.

The index of the Role related to the .

The ID of the the Role is assigned to.

The IDs of to grant the Role.

The IDs of the Role has "advanced access" to view content from.

The IDs of the Role is allowed to assign to.

The ID of the Role is assigned to.

The index of the Role related to the .

Department
Department
User
Department
Folder
Departments
Departments
Permissions
Users
Department
Permissions
Departments
Departments
InfoboardPosts
Folder
Folder
Department
Permissions
Departments
Departments
InfoboardPosts
Folder
Folder