{"action":"created","comment":{"url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/comments/38103923","id":38103923,"diff_hunk":"@@ -0,0 +1,126 @@\n+/**\n+ * Copyright 2015 DuraSpace, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.fcrepo.auth.webac;\n+\n+import java.net.URI;\n+import java.util.Set;\n+\n+import com.hp.hpl.jena.vocabulary.RDF;\n+\n+/**\n+ * AuthorizationHandler defines the interface for configuring and retrieving\n+ * WebAC authorization of fedora objects.\n+ *\n+ * @author mohideen\n+ * @date 8/25/15.\n+ */\n+public interface AuthorizationHandler {\n+\n+\n+    /**\n+     * Get authorizations that have both accessTo\n+     * @param aclPath Path of acl to get authorizations.\n+     * @param resourcePath Path of the resource requested by user. (ACL: accessTo)\n+     * @param objectTypes rdf:type values of the resource. (ACL: accessToClass)\n+     * @param agent (user or group) (ACL: agent)\n+     * @return Set of applicable authorizations for the agent on the resource from the specified acl path.\n+     */\n+    Set<WebACAuthorization> getAuthorizations(final String aclPath, final String resourcePath, final Set<RDF> objectTypes, final String agent);\n+\n+    /**\n+     * Get authorizations that have both accessTo\n+     * @param resource Resource requested by user.\n+     * @param agent (user or group) (ACL: agent)\n+     * @return Set of applicable authorizations for the agent on the resource.\n+     */\n+    Set<WebACAuthorization> getAuthorizations(final FedoraResource resource, final String agent);\n+\n+    /**\n+     * Add allowed access modes for resource with specified set of agents.\n+     * @param aclPath Path of existing acl resource\n+     * @param resourcePath Path of fedora resource (ACL: accessTo)\n+     * @param accessModes Modes of access to be allowed. (ACL: mode)\n+     * @param agents (user or group) (ACL: agent)\n+     */\n+    void addAuthorizations(final String aclPath, final String resourcePath, final Set<URI> accessModes, final Set<String> agents);","path":"src/main/java/org/fcrepo/auth/webac/AuthorizationHandler.java","position":58,"original_position":58,"commit_id":"38242b915100c4e873798a4f196a617521df5621","original_commit_id":"38242b915100c4e873798a4f196a617521df5621","user":{"login":"mohideen","id":1703851,"avatar_url":"https://avatars.githubusercontent.com/u/1703851?v=3","gravatar_id":"","url":"https://api.github.com/users/mohideen","html_url":"https://github.com/mohideen","followers_url":"https://api.github.com/users/mohideen/followers","following_url":"https://api.github.com/users/mohideen/following{/other_user}","gists_url":"https://api.github.com/users/mohideen/gists{/gist_id}","starred_url":"https://api.github.com/users/mohideen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohideen/subscriptions","organizations_url":"https://api.github.com/users/mohideen/orgs","repos_url":"https://api.github.com/users/mohideen/repos","events_url":"https://api.github.com/users/mohideen/events{/privacy}","received_events_url":"https://api.github.com/users/mohideen/received_events","type":"User","site_admin":false},"body":"Would it make more sense to get a single agent instead of a Set? i.e what will be the more common use case?","created_at":"2015-08-27T14:49:58Z","updated_at":"2015-08-27T14:49:58Z","html_url":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac/pull/7#discussion_r38103923","pull_request_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/comments/38103923"},"html":{"href":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac/pull/7#discussion_r38103923"},"pull_request":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/7","id":43337431,"html_url":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac/pull/7","diff_url":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac/pull/7.diff","patch_url":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac/pull/7.patch","issue_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/issues/7","number":7,"state":"open","locked":false,"title":"Created AuthorizationHandler interface.","user":{"login":"mohideen","id":1703851,"avatar_url":"https://avatars.githubusercontent.com/u/1703851?v=3","gravatar_id":"","url":"https://api.github.com/users/mohideen","html_url":"https://github.com/mohideen","followers_url":"https://api.github.com/users/mohideen/followers","following_url":"https://api.github.com/users/mohideen/following{/other_user}","gists_url":"https://api.github.com/users/mohideen/gists{/gist_id}","starred_url":"https://api.github.com/users/mohideen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohideen/subscriptions","organizations_url":"https://api.github.com/users/mohideen/orgs","repos_url":"https://api.github.com/users/mohideen/repos","events_url":"https://api.github.com/users/mohideen/events{/privacy}","received_events_url":"https://api.github.com/users/mohideen/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-25T21:13:04Z","updated_at":"2015-08-27T14:49:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afff4ae7d9f39804ac1adc2da445ac343965e81a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/7/commits","review_comments_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/7/comments","review_comment_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/issues/7/comments","statuses_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/statuses/38242b915100c4e873798a4f196a617521df5621","head":{"label":"mohideen:accessToClass","ref":"accessToClass","sha":"38242b915100c4e873798a4f196a617521df5621","user":{"login":"mohideen","id":1703851,"avatar_url":"https://avatars.githubusercontent.com/u/1703851?v=3","gravatar_id":"","url":"https://api.github.com/users/mohideen","html_url":"https://github.com/mohideen","followers_url":"https://api.github.com/users/mohideen/followers","following_url":"https://api.github.com/users/mohideen/following{/other_user}","gists_url":"https://api.github.com/users/mohideen/gists{/gist_id}","starred_url":"https://api.github.com/users/mohideen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohideen/subscriptions","organizations_url":"https://api.github.com/users/mohideen/orgs","repos_url":"https://api.github.com/users/mohideen/repos","events_url":"https://api.github.com/users/mohideen/events{/privacy}","received_events_url":"https://api.github.com/users/mohideen/received_events","type":"User","site_admin":false},"repo":{"id":41309827,"name":"fcrepo-module-auth-webac","full_name":"mohideen/fcrepo-module-auth-webac","owner":{"login":"mohideen","id":1703851,"avatar_url":"https://avatars.githubusercontent.com/u/1703851?v=3","gravatar_id":"","url":"https://api.github.com/users/mohideen","html_url":"https://github.com/mohideen","followers_url":"https://api.github.com/users/mohideen/followers","following_url":"https://api.github.com/users/mohideen/following{/other_user}","gists_url":"https://api.github.com/users/mohideen/gists{/gist_id}","starred_url":"https://api.github.com/users/mohideen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohideen/subscriptions","organizations_url":"https://api.github.com/users/mohideen/orgs","repos_url":"https://api.github.com/users/mohideen/repos","events_url":"https://api.github.com/users/mohideen/events{/privacy}","received_events_url":"https://api.github.com/users/mohideen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mohideen/fcrepo-module-auth-webac","description":"WebAC Authorization Delegate Module for the Fedora 4 Repository","fork":true,"url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac","forks_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/forks","keys_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/teams","hooks_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/hooks","issue_events_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/issues/events{/number}","events_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/events","assignees_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/assignees{/user}","branches_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/branches{/branch}","tags_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/tags","blobs_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/git/refs{/sha}","trees_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/statuses/{sha}","languages_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/languages","stargazers_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/stargazers","contributors_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/contributors","subscribers_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/subscribers","subscription_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/subscription","commits_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/commits{/sha}","git_commits_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/git/commits{/sha}","comments_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/comments{/number}","issue_comment_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/issues/comments{/number}","contents_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/contents/{+path}","compare_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/merges","archive_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/downloads","issues_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/issues{/number}","pulls_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/pulls{/number}","milestones_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/milestones{/number}","notifications_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/labels{/name}","releases_url":"https://api.github.com/repos/mohideen/fcrepo-module-auth-webac/releases{/id}","created_at":"2015-08-24T15:04:28Z","updated_at":"2015-08-24T13:56:04Z","pushed_at":"2015-08-27T13:28:44Z","git_url":"git://github.com/mohideen/fcrepo-module-auth-webac.git","ssh_url":"git@github.com:mohideen/fcrepo-module-auth-webac.git","clone_url":"https://github.com/mohideen/fcrepo-module-auth-webac.git","svn_url":"https://github.com/mohideen/fcrepo-module-auth-webac","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fcrepo4-labs:master","ref":"master","sha":"0c255d70a04500f5f2abf9087fad5563bb3e2140","user":{"login":"fcrepo4-labs","id":7586101,"avatar_url":"https://avatars.githubusercontent.com/u/7586101?v=3","gravatar_id":"","url":"https://api.github.com/users/fcrepo4-labs","html_url":"https://github.com/fcrepo4-labs","followers_url":"https://api.github.com/users/fcrepo4-labs/followers","following_url":"https://api.github.com/users/fcrepo4-labs/following{/other_user}","gists_url":"https://api.github.com/users/fcrepo4-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/fcrepo4-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fcrepo4-labs/subscriptions","organizations_url":"https://api.github.com/users/fcrepo4-labs/orgs","repos_url":"https://api.github.com/users/fcrepo4-labs/repos","events_url":"https://api.github.com/users/fcrepo4-labs/events{/privacy}","received_events_url":"https://api.github.com/users/fcrepo4-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":41306056,"name":"fcrepo-module-auth-webac","full_name":"fcrepo4-labs/fcrepo-module-auth-webac","owner":{"login":"fcrepo4-labs","id":7586101,"avatar_url":"https://avatars.githubusercontent.com/u/7586101?v=3","gravatar_id":"","url":"https://api.github.com/users/fcrepo4-labs","html_url":"https://github.com/fcrepo4-labs","followers_url":"https://api.github.com/users/fcrepo4-labs/followers","following_url":"https://api.github.com/users/fcrepo4-labs/following{/other_user}","gists_url":"https://api.github.com/users/fcrepo4-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/fcrepo4-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fcrepo4-labs/subscriptions","organizations_url":"https://api.github.com/users/fcrepo4-labs/orgs","repos_url":"https://api.github.com/users/fcrepo4-labs/repos","events_url":"https://api.github.com/users/fcrepo4-labs/events{/privacy}","received_events_url":"https://api.github.com/users/fcrepo4-labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac","description":"WebAC Authorization Delegate Module for the Fedora 4 Repository","fork":false,"url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac","forks_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/forks","keys_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/teams","hooks_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/hooks","issue_events_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/issues/events{/number}","events_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/events","assignees_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/assignees{/user}","branches_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/branches{/branch}","tags_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/tags","blobs_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/git/refs{/sha}","trees_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/statuses/{sha}","languages_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/languages","stargazers_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/stargazers","contributors_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/contributors","subscribers_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/subscribers","subscription_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/subscription","commits_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/commits{/sha}","git_commits_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/git/commits{/sha}","comments_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/comments{/number}","issue_comment_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/issues/comments{/number}","contents_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/contents/{+path}","compare_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/merges","archive_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/downloads","issues_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/issues{/number}","pulls_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls{/number}","milestones_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/milestones{/number}","notifications_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/labels{/name}","releases_url":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/releases{/id}","created_at":"2015-08-24T13:56:04Z","updated_at":"2015-08-25T14:56:05Z","pushed_at":"2015-08-27T13:57:47Z","git_url":"git://github.com/fcrepo4-labs/fcrepo-module-auth-webac.git","ssh_url":"git@github.com:fcrepo4-labs/fcrepo-module-auth-webac.git","clone_url":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac.git","svn_url":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/7"},"html":{"href":"https://github.com/fcrepo4-labs/fcrepo-module-auth-webac/pull/7"},"issue":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/issues/7"},"comments":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/fcrepo4-labs/fcrepo-module-auth-webac/statuses/38242b915100c4e873798a4f196a617521df5621"}}}}