Permissions models ============== All models on 3DIAX can be permissiond. Users can be given specific or all rights on a model. Note that the *MES* system automatically controls all permissions for related resources, and *MES* users can skip this section if they are not using the API directly. Here is a list of possible rights: * **all**: This right gives full access to the resource. * **print**: This right gives print right which permits printing a resource. * **transform**: This right permits running internal transforms of a resource. * **transform-external**: This right allows external transforms of a resource. * **view**: This right lets a user view/download a resource. * **download**: This right lets a user downloaded a resource. Create a new permission ----------------------- Now that we know the list of rights we can give on something lets try it. This example givess permission a model with user named John. In this example, John's account is a ``user`` resorce with a unique ID of ``123-456``. The model is a ``model`` account with a unique ID of ``abc-xyz``. .. sourcecode:: javascript POST https://data.authentise.com/permission/ Content-Type: application/json { "model": "https://data.authentise.com/model/abc-xyz/', "user": "https://users.authentise.com/user/123-456/", "type": "all" } .. sourcecode:: javascript Location: https://users.authentise.com/permission/abc-xyz/ After the above call is executed, user `https://users.authentise.com/user/abc-xyz/` will be granted right `all` on model `https://data.authentise.com/model/abc-xyz/` List our own permissions -------------------------- This request will return all of our permissions. In this mini-example, if done on a fresh system this would contain only one entry so far. The LIST system also add some context data for pagination, and total resource count, which is included in all LIST commands. The core fo data appears in ``resources`` section of the response. .. sourcecode:: javascript GET https://data.authentise.com/permission/ Content-Type: application/json .. sourcecode:: javascript { "links" : { "self" : https://data.authentise.com/permission/", "next" : null, "prev" : null, }, "meta" : {"count":1}, "resources": [{ "model": "https://data.authentise.com/model/abc-xyz/", "user": "https://users.authentise.com/user/abc-xyz/", "type": "all", "grantor": "https://users.authentise.com/user/abc-xyz/" }] } In this example, we only have one permission that gave us full access to model `abc-xyz`. Delete a permission ------------------------------ In the first example, we granted `all` right on our model to John. Here is how to revoke this right and to hide the model from them. .. sourcecode:: javascript DELETE https://data.authentise.com/permission/abc-xyz/ This will delete the permission abc-xyz that gave `all` right to John.