{"action":"created","issue":{"url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1644","repository_url":"https://api.github.com/repos/hydroshare/hydroshare","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1644/labels{/name}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1644/comments","events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1644/events","html_url":"https://github.com/hydroshare/hydroshare/issues/1644","id":192563006,"number":1644,"title":"UI and REST API need a shared ground truth for application logic ","user":{"login":"alvacouch","id":3342292,"avatar_url":"https://avatars.githubusercontent.com/u/3342292?v=3","gravatar_id":"","url":"https://api.github.com/users/alvacouch","html_url":"https://github.com/alvacouch","followers_url":"https://api.github.com/users/alvacouch/followers","following_url":"https://api.github.com/users/alvacouch/following{/other_user}","gists_url":"https://api.github.com/users/alvacouch/gists{/gist_id}","starred_url":"https://api.github.com/users/alvacouch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvacouch/subscriptions","organizations_url":"https://api.github.com/users/alvacouch/orgs","repos_url":"https://api.github.com/users/alvacouch/repos","events_url":"https://api.github.com/users/alvacouch/events{/privacy}","received_events_url":"https://api.github.com/users/alvacouch/received_events","type":"User","site_admin":false},"labels":[{"id":233666859,"url":"https://api.github.com/repos/hydroshare/hydroshare/labels/Design","name":"Design","color":"e11d21","default":false},{"id":233668032,"url":"https://api.github.com/repos/hydroshare/hydroshare/labels/REST%20API","name":"REST API","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"aphelionz","id":106148,"avatar_url":"https://avatars.githubusercontent.com/u/106148?v=3","gravatar_id":"","url":"https://api.github.com/users/aphelionz","html_url":"https://github.com/aphelionz","followers_url":"https://api.github.com/users/aphelionz/followers","following_url":"https://api.github.com/users/aphelionz/following{/other_user}","gists_url":"https://api.github.com/users/aphelionz/gists{/gist_id}","starred_url":"https://api.github.com/users/aphelionz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aphelionz/subscriptions","organizations_url":"https://api.github.com/users/aphelionz/orgs","repos_url":"https://api.github.com/users/aphelionz/repos","events_url":"https://api.github.com/users/aphelionz/events{/privacy}","received_events_url":"https://api.github.com/users/aphelionz/received_events","type":"User","site_admin":false},"assignees":[{"login":"aphelionz","id":106148,"avatar_url":"https://avatars.githubusercontent.com/u/106148?v=3","gravatar_id":"","url":"https://api.github.com/users/aphelionz","html_url":"https://github.com/aphelionz","followers_url":"https://api.github.com/users/aphelionz/followers","following_url":"https://api.github.com/users/aphelionz/following{/other_user}","gists_url":"https://api.github.com/users/aphelionz/gists{/gist_id}","starred_url":"https://api.github.com/users/aphelionz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aphelionz/subscriptions","organizations_url":"https://api.github.com/users/aphelionz/orgs","repos_url":"https://api.github.com/users/aphelionz/repos","events_url":"https://api.github.com/users/aphelionz/events{/privacy}","received_events_url":"https://api.github.com/users/aphelionz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":14,"created_at":"2016-11-30T13:17:10Z","updated_at":"2016-12-15T20:12:22Z","closed_at":null,"body":"@pkdash @dtarb @mauriel133 @horsburgh \r\nIssue #1618 demonstrates a design issue that is going to come up repeatedly as we try to complete the REST API. Much of the application logic of HydroShare -- including what can be done to each kind of resource -- is only implemented at the UI level. Though there is a [spreadsheet](https://docs.google.com/spreadsheets/d/1tc-6tIq_YkJpa2CGj5tAEHMaLOZV2i3W10lokBCJAn0/edit#gid=0) defining some what this logic is, it covers only file/folder issues and is not comprehensive. A systematic approach needs to be developed that serves as \"ground truth\" for both the UI and the REST API as to how to implement this application logic. \r\n\r\n* A common approach -- though I am not yet recommending this -- is to make the REST API definitive and have the UI refer to it as to what is allowed. Thus, the application logic is implemented as a set of external and internal REST endpoints. The reason people do this is that REST helps one code this easily. \r\n\r\n* The other way to approach this is to create application middleware that both the UI and REST interface refer to in determining application logic. This is what the access control system is, but it is only a subsystem of application logic and does not document the limits of what can be done in editing each kind of resource. We would need a different logic engine to determine what one \"can\" do to each kind of resource, separate from the UI. This would not be an authorization logic like access control, but rather, a **validation logic** for edits that determines what kinds of edits can be performed without violating resource type limitations.  Our existing validators are not comprehensive enough to serve this function -- yet. \r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments/267431344","html_url":"https://github.com/hydroshare/hydroshare/issues/1644#issuecomment-267431344","issue_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1644","id":267431344,"user":{"login":"aphelionz","id":106148,"avatar_url":"https://avatars.githubusercontent.com/u/106148?v=3","gravatar_id":"","url":"https://api.github.com/users/aphelionz","html_url":"https://github.com/aphelionz","followers_url":"https://api.github.com/users/aphelionz/followers","following_url":"https://api.github.com/users/aphelionz/following{/other_user}","gists_url":"https://api.github.com/users/aphelionz/gists{/gist_id}","starred_url":"https://api.github.com/users/aphelionz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aphelionz/subscriptions","organizations_url":"https://api.github.com/users/aphelionz/orgs","repos_url":"https://api.github.com/users/aphelionz/repos","events_url":"https://api.github.com/users/aphelionz/events{/privacy}","received_events_url":"https://api.github.com/users/aphelionz/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T20:12:22Z","updated_at":"2016-12-15T20:12:22Z","body":"Copy that, @alvacouch. Thanks for the context My proposal stands."}}
{"actor":{"display_login":"aphelionz"}}