{"action":"opened","issue":{"url":"https://api.github.com/repos/ifunsoftware/c3-next/issues/13","labels_url":"https://api.github.com/repos/ifunsoftware/c3-next/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/ifunsoftware/c3-next/issues/13/comments","events_url":"https://api.github.com/repos/ifunsoftware/c3-next/issues/13/events","html_url":"https://github.com/ifunsoftware/c3-next/issues/13","id":112057347,"number":13,"title":"User-based File Access Control: a proposal","user":{"login":"ajantis","id":852618,"avatar_url":"https://avatars.githubusercontent.com/u/852618?v=3","gravatar_id":"","url":"https://api.github.com/users/ajantis","html_url":"https://github.com/ajantis","followers_url":"https://api.github.com/users/ajantis/followers","following_url":"https://api.github.com/users/ajantis/following{/other_user}","gists_url":"https://api.github.com/users/ajantis/gists{/gist_id}","starred_url":"https://api.github.com/users/ajantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajantis/subscriptions","organizations_url":"https://api.github.com/users/ajantis/orgs","repos_url":"https://api.github.com/users/ajantis/repos","events_url":"https://api.github.com/users/ajantis/events{/privacy}","received_events_url":"https://api.github.com/users/ajantis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-19T01:44:41Z","updated_at":"2015-10-19T01:44:41Z","closed_at":null,"body":"# User-based File Access Control\r\n\r\nWe'd like to have a way to restrict access to file resources per user or group.\r\n\r\nThis issue is a place for all related discussions about a solution and its architecture.\r\n\r\n## Users and Groups in C3\r\n\r\nA user in C3 Web can have multiple groups assigned to him.\r\nAnd each file resource has an owner (a User) and a group owner (a Group).\r\n\r\nEach request for C3 file resource can contain an information about the user which is trying to access it.\r\nIf this information is omitted it's not taken into account when C3 Access Manager components is about to make a decision whether to allow access or not.\r\n\r\nIf information about user trying to access resource is provided then two things are considered:\r\n* User identity itself (User ID)\r\n* List of users's group (Group IDs)\r\n\r\n1. If user is an owner of the file resource then the 'resource owner access' is verified (Read & Write).\r\n2. If the file resource is owned by one of the users's group then the 'group owner access' is verified (Read or Write).\r\n3. If neither of the first two is true then an access for 'others' is checked for this resource: whether other users have any (Read or Write) access to a resource or not.\r\n\r\nThe main idea behind user-based access control is providing user authorisation for file resources. Authentication is not part of the scope.\r\n\r\n## Implementation\r\n\r\nThe implementation can be split into a few parts:\r\n\r\n1. Extending file system metadata: add a notion of ‘Owner’ and ‘Owner group’ (Should it be optional?).\r\n2. Add support for ‘user’ and ‘user's groups’ info in REST API Requests.\r\n3. Search should respect user-based access control rules if they are applicable and filter out results accordingly.\r\nIt’s assumed that filtering out should be done solely in the server-side because of performance and, more importantly, security concerts.\r\n\r\n## Important Notes\r\n\r\n1. C3 is NOT responsible for maintaining a users repository.\r\n2. C3 is NOT responsible for users authentication (only authorising access to C3 resources). See the difference: http://www.cyberciti.biz/faq/authentication-vs-authorization/\r\n\r\n## Search\r\n\r\nWhen a search query is submitted then the scope of the search should depend on resources access control for a given (if given) user.\r\nI.e. if a user doesn't have any access for some file resource then this resource should not be returned in the response with search results."}}