{"action":"created","issue":{"url":"https://api.github.com/repos/ctoec/ecis-experimental/issues/261","repository_url":"https://api.github.com/repos/ctoec/ecis-experimental","labels_url":"https://api.github.com/repos/ctoec/ecis-experimental/issues/261/labels{/name}","comments_url":"https://api.github.com/repos/ctoec/ecis-experimental/issues/261/comments","events_url":"https://api.github.com/repos/ctoec/ecis-experimental/issues/261/events","html_url":"https://github.com/ctoec/ecis-experimental/pull/261","id":522575706,"node_id":"MDExOlB1bGxSZXF1ZXN0MzQwNzUwNDEy","number":261,"title":"232 authorization","user":{"login":"jlhogan","id":54035880,"node_id":"MDQ6VXNlcjU0MDM1ODgw","avatar_url":"https://avatars1.githubusercontent.com/u/54035880?v=4","gravatar_id":"","url":"https://api.github.com/users/jlhogan","html_url":"https://github.com/jlhogan","followers_url":"https://api.github.com/users/jlhogan/followers","following_url":"https://api.github.com/users/jlhogan/following{/other_user}","gists_url":"https://api.github.com/users/jlhogan/gists{/gist_id}","starred_url":"https://api.github.com/users/jlhogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlhogan/subscriptions","organizations_url":"https://api.github.com/users/jlhogan/orgs","repos_url":"https://api.github.com/users/jlhogan/repos","events_url":"https://api.github.com/users/jlhogan/events{/privacy}","received_events_url":"https://api.github.com/users/jlhogan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-11-14T01:55:51Z","updated_at":"2019-11-18T18:25:42Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/ctoec/ecis-experimental/pulls/261","html_url":"https://github.com/ctoec/ecis-experimental/pull/261","diff_url":"https://github.com/ctoec/ecis-experimental/pull/261.diff","patch_url":"https://github.com/ctoec/ecis-experimental/pull/261.patch"},"body":"- Implements simple authorization requirements to enforce user access to an organization or a site; see: `Security_NEW/UserSiteAccessRequirement.cs` and `Security_New/UserOrganizationAccessRequirement.cs`\r\n- Adds each custom requirement to an authorization policy; see: `ServiceExtensions.cs` and `Startup.cs`\r\n- Adds a multi-policy AuthorizationHandler, called `PermissionHandler` for now copied from a microsoft example, but maybe confusing since nothing else is called \"permissions\"; see: `Secutiry_NEW/PermissionHandler.cs`\r\n\r\nnote: this does not explicitly add an authenticated user requirement. the requirement is implicit in the other requirements. this may not be the best design.\r\n\r\nTODO: actually implement the PermissionRepository code for user/site and user/organization logic\r\n\r\ncloses #232 "},"comment":{"url":"https://api.github.com/repos/ctoec/ecis-experimental/issues/comments/555145473","html_url":"https://github.com/ctoec/ecis-experimental/pull/261#issuecomment-555145473","issue_url":"https://api.github.com/repos/ctoec/ecis-experimental/issues/261","id":555145473,"node_id":"MDEyOklzc3VlQ29tbWVudDU1NTE0NTQ3Mw==","user":{"login":"cailyncodes","id":16420449,"node_id":"MDQ6VXNlcjE2NDIwNDQ5","avatar_url":"https://avatars0.githubusercontent.com/u/16420449?v=4","gravatar_id":"","url":"https://api.github.com/users/cailyncodes","html_url":"https://github.com/cailyncodes","followers_url":"https://api.github.com/users/cailyncodes/followers","following_url":"https://api.github.com/users/cailyncodes/following{/other_user}","gists_url":"https://api.github.com/users/cailyncodes/gists{/gist_id}","starred_url":"https://api.github.com/users/cailyncodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cailyncodes/subscriptions","organizations_url":"https://api.github.com/users/cailyncodes/orgs","repos_url":"https://api.github.com/users/cailyncodes/repos","events_url":"https://api.github.com/users/cailyncodes/events{/privacy}","received_events_url":"https://api.github.com/users/cailyncodes/received_events","type":"User","site_admin":false},"created_at":"2019-11-18T18:25:42Z","updated_at":"2019-11-18T18:25:42Z","author_association":"CONTRIBUTOR","body":"> \r\n> \r\n> thoughts on encapsulating access check in repository? Alternative is repo exposing something like: `GetPermittedSiteIdsByUserId` and `GetPermittedOrganizationIdsByUserId` and then doing the check in the authorizationrequirements\r\n> (@cmgiven also maybe has thoughts as OG repo implementor?)\r\n\r\nI guess I don't understand what the \"access check in repository\" would look like? The alternative you mention seems reasonable to me, and moreover I think provides transparency in the authorization requirement class what is happening."}}
{"actor":{"display_login":"cailyncodes"}}