Skip to content

Model and Relations

Model

Entity permissions contain information about which User or Group has a specific Key in a specific Model (or table).

The fields of a permission are as follows:

FieldDescriptionExample Value
keyThe permission keyprogress
permission_entityModel type to grant the permission key forApp\User or App\Department
permission_entity_idThe id of permission_entity25
target_entityModel type of the target content to grant the permission key forModules\Tasks\Entities\Task
target_entity_idThe id of target_entity10

Relations

Models provided by the intratool API that are Restrictable will always have a relation key entityPermissions that gives information about permissions attached to the content.

See Query Manipulation to learn how to retrieve this information by requesting our endpoints.

Adding permissions

When creating or updating content by requesting the intratool API you can always add the fieldkey entity_permissions if the model the endpoint grants access to is Restrictable.

The entity_permissions value is expected to be an array with one or more permission definitions. The following structure is expected:

json
[
    {
        "key": "view",
        "target_entity": "App\User"
        "target_entity_id": 25
    },
    {
        "key": "view",
        "target_entity": "App\User"
        "target_entity_id": 27
    }
]