Documentation
Permissions
An explanation of how Permissions are used to control access to Markets and Tradeable Items.
How Permissions Work
When you create a new Market or Tradeable Item, it is by default created Private to you. You have full rights over it, but no one else can see or use it.
You can grant permissions to other Users to let them view, use or change your Markets and Tradeable Items.
For Markets, you can grant other Users the right to view or edit the Market, trade on the Market, see Fills on the Market, or become an Owner of the Market.
For Tradeable Items, you can grant other Users the right to view, edit or become an Owner of that Tradeable Item.
Market Permissions
Any Market you create is by default Private to you only. You are given full rights to your new Markets.
The permission rights are represented by their initial letter. Here are the possible rights to Markets that you can assign to other Users:
- O: OWNER; An Owner can open and close the Market, delete the Market, and assign rights to other Users.
- T: TRADE; A User must have this right to be able to place Orders on the Market.
- V: VIEW; This right is required to see Price data for the Market.
- E: EDIT; Users require this right to make configuration changes to the Market, such as market depth, display name or expiry date.
- F: FILL; Fills can only be seen and changed with this right.
Tradeable Permissions
Any Tradeable Item that you create is by default Private to you only. You are given full rights to any new Tradeable Items you create.
The permission rights are represented by their initial letter. Here are the possible rights to Tradeable Items that you can assign to other Users:
- O: OWNER; An Owner can assign rights to other Users for the Tradeable Item and delete the Tradeable Item.
- V: VIEW; This right is required to see this Tradeable Item and use it in a Market.
- E: EDIT; Users require this right to make configuration changes to the Tradeable Item, such as the display name or expiry date.
Permissioning Mechanics Under the Hood
The system database has two tables within it to manage permission rights for Users to Tradeable Items and Markets. The User Tradeable Junction table can contain a record for each combination of User and Tradeable Item, and stores the rights that the User has to that Tradeable Item as a string of letters. Similarly, the User Market Junction table can contain a record for each combination of User and Market, and stores the rights that the User has to that Market as a string of letters.
When a User tries to interact with a Market or Tradeable Item, the string of letters that holds their rights is retrieved. If the User has the required rights letter in their string, they have that right.
For example, if you have a Market, and you want to grant another User the right to see Price data and trade on the Market, you assign them a string "TV". (The order of the rights letters does not matter.)
Changes to rights take place immediately, so if you need to revoke a User's rights (such as a bad actor) you would assign them an empty rights string "". This bad actor would still be logged in, but when they next try to interact with your Market, their rights would be retrieved, be found to be empty, and their access would be denied.
Private vs Public
When you create new Tradeable Items or Markets, they are always Private to you. There are Tradeable Items, such as currencies, that are available to all Users to include in their Markets. Markets can also be Public, but there must be a compelling use case for creating such a Market.