Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Permissions

goje87 edited this page Feb 1, 2012 · 1 revision
  1. Every object will have an owner who has right to do anything with the object.
  2. There will be a special user 'all' which means everyone. The user id of 'all' is 'all' itself.
  3. Every objects would maintain the information about the permission rights in meta.rights which will be as per the snippet given below.
  4. meta.rights.xxx (where xxx can be either view, modify or delete) would store an array of user ids who would have permission to perform the respective action.
  5. Since the owner has right to perform any action, his id need not be present in any of the list mentioned above.

Example object to indicate meta.rights

{
  username: 'goje87',
  fullname: 'Abhilash Goje',
  meta: {
    id: 'xxxxxxxx',
    type: 'xxxxx',
    rights: {
      view: ['all'],
      modify: ['xxxxxxxx', 'xxxxxxxx',...],
      delete: ['xxxxxxx', 'xxxxxx']
    }
  }
}

Clone this wiki locally