Ruza Drive / Guides
Permissions and restrictions
The 12 permissions of a Ruza'Gency API key, the endpoints each one opens, the key templates and the folder and IP address restrictions.
How it works
A key holds only the permissions you give it. Every endpoint requires exactly those its "Access" line states, and a write permission does not imply reading. Without the permission, the answer is 403 missing_permission, and details.missing names it.
Two permissions are sensitive and shown in red in your account: Delete permanently, irreversible, and Create and manage share links, because a public link takes files out of the account.
The 12 permissions
See the plan, the quota and the space used
drive.account:read
The account, its plan and quota, the space by type and by folder.
See files and folders
drive.files:read
Entries and their paths, folder contents, search, recent files, favourites, the list of versions, the change feed.
Download file contents
drive.files:download
The content of files and of their versions, ZIP archives.
Add and organise files
drive.files:write
Create folders, upload files and versions, rename, move, copy, manage favourites, restore a version.
Move to the trash and restore
drive.files:trash
Move to the trash, list the trash, restore from it.
Delete permanently
drive.files:deletesensitive
Permanently delete an item of the trash, empty it, delete an older version. Irreversible.
See who has access
drive.members:read
The people your files and folders are shared with.
Manage people's access
drive.members:write
Change a person's role, remove their access.
Key templates
When creating a key, a template ticks the permissions of a common use; you may then adjust them one by one.
| Template | Permissions |
|---|---|
| Read only | drive.account:read, drive.files:read, drive.files:download, drive.share_links:read, drive.members:read, drive.shared:read |
| Backup | drive.account:read, drive.files:read, drive.files:write |
| Read and write | drive.account:read, drive.files:read, drive.files:download, drive.share_links:read, drive.members:read, drive.shared:read, drive.files:write, drive.files:trash, drive.shared:write |
| Full access | All of them |
Folder restriction
A key may see only one folder and its content. root then names that folder, and paths (path, GET /entries/by-path) start from it. An entry outside the folder answers 404, without telling whether it exists. If the folder goes to the trash or is deleted, the key answers 409 scope_unavailable until it is restored.
The endpoints that cover the whole account refuse a key restricted to a folder (403 folder_restricted):
- getSpace by file type
- getSpace by top-level folder
- getFollow changes
- getCursor from now on
- getList the trash
- deleteEmpty the trash
- postRestore from the trash
- deleteDelete permanently
- getEveryone with access
- patchChange a role
- deleteRemove an access
- getShared with me
- deleteLeave a share
- getA share
- getAn entry of a share
- patchRename or move in a share
- deleteTrash in a share
- getList a folder of a share
- getDownload from a share
- postPrepare a ZIP from a share
- getDownload a ZIP from a share
- postCreate a folder in a share
- postUpload into a share
- postStart an upload in a share
- getState of an upload in a share
- deleteCancel an upload in a share
- putSend a block in a share
- postComplete an upload in a share
IP address restriction
A key may be kept to 10 address ranges at most (CIDR, IPv4 and IPv6), those of your server for instance. The address taken is the one that reaches the server, never a header the caller sends. Outside the ranges: 403 ip_not_allowed.
Actions kept for the application
Some actions need a recent sign-in, which a key does not prove. Through the API they answer 403 web_only; do them in the Ruza Drive application:
- inviting a person to a folder or a file;
- transferring the ownership of a file to another account;
- creating a link that accepts deposits (
read_write), removing a link's password or reactivating a link; - restoring an item trashed long ago.
Keys themselves are created, restricted and revoked only in your Ruza'Gency account, never through the API.