{"action":"created","comment":{"url":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/comments/50378124","id":50378124,"diff_hunk":"@@ -3,22 +3,37 @@\n import org.springframework.beans.factory.annotation.Autowired;\n import org.springframework.security.acls.model.Permission;\n \n+import fr.openwide.core.basicapp.core.business.referential.model.City;\n import fr.openwide.core.basicapp.core.business.user.model.User;\n import fr.openwide.core.jpa.security.service.AbstractCorePermissionEvaluator;\n import fr.openwide.core.jpa.security.service.ISecurityService;\n+import fr.openwide.core.jpa.util.HibernateUtils;\n \n public class BasicApplicationPermissionEvaluator extends AbstractCorePermissionEvaluator<User> {\n \n \t@Autowired\n \tprivate ISecurityService securityService;\n \n+\t@Autowired\n+\tprivate IDefaultGenericListItemPermissionEvaluator defaultGenericListItemPermissionEvaluator;\n+\t\n \tpublic BasicApplicationPermissionEvaluator() {\n \t}\n \n \t@Override\n \tprotected boolean hasPermission(User user, Object targetDomainObject, Permission permission) {\n-\t\t// Déléguer ici les permissions aux différents PermissionEvaluator pour chaque objet métier\n-\t\t// Au besoin, court-circuiter les vérifications pour le super user : if(isSuperUser(user) { return true }\n+\t\tif (targetDomainObject != null) {\n+\t\t\ttargetDomainObject = HibernateUtils.unwrap(targetDomainObject); // NOSONAR\n+\t\t}\n+\t\t\n+\t\tif (user != null) {\n+\t\t\tuser = HibernateUtils.unwrap(user); // NOSONAR\n+\t\t}\n+\t\t\n+\t\tif (targetDomainObject instanceof City) {","path":"basic-application/basic-application-core/src/main/java/fr/openwide/core/basicapp/core/security/service/BasicApplicationPermissionEvaluator.java","position":33,"original_position":33,"commit_id":"61049e3b842226b9b21dcd1408313c8224f7e0d3","original_commit_id":"61049e3b842226b9b21dcd1408313c8224f7e0d3","user":{"login":"fenrhil","id":412878,"avatar_url":"https://avatars.githubusercontent.com/u/412878?v=3","gravatar_id":"","url":"https://api.github.com/users/fenrhil","html_url":"https://github.com/fenrhil","followers_url":"https://api.github.com/users/fenrhil/followers","following_url":"https://api.github.com/users/fenrhil/following{/other_user}","gists_url":"https://api.github.com/users/fenrhil/gists{/gist_id}","starred_url":"https://api.github.com/users/fenrhil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenrhil/subscriptions","organizations_url":"https://api.github.com/users/fenrhil/orgs","repos_url":"https://api.github.com/users/fenrhil/repos","events_url":"https://api.github.com/users/fenrhil/events{/privacy}","received_events_url":"https://api.github.com/users/fenrhil/received_events","type":"User","site_admin":false},"body":"I think there still should be a comment here explaining \"call your own permissionEvaluators here\".\r\nPlus, this line should be `instanceof GenericListItem` since this is supposed to be the default permission evaluator for all generic list items. Same goes for the cast below.","created_at":"2016-01-21T09:41:33Z","updated_at":"2016-01-21T09:41:33Z","html_url":"https://github.com/openwide-java/owsi-core-parent/pull/22#discussion_r50378124","pull_request_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/comments/50378124"},"html":{"href":"https://github.com/openwide-java/owsi-core-parent/pull/22#discussion_r50378124"},"pull_request":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/22","id":56361713,"html_url":"https://github.com/openwide-java/owsi-core-parent/pull/22","diff_url":"https://github.com/openwide-java/owsi-core-parent/pull/22.diff","patch_url":"https://github.com/openwide-java/owsi-core-parent/pull/22.patch","issue_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues/22","number":22,"state":"open","locked":false,"title":"Management of GenericListItems","user":{"login":"daboooo","id":1834546,"avatar_url":"https://avatars.githubusercontent.com/u/1834546?v=3","gravatar_id":"","url":"https://api.github.com/users/daboooo","html_url":"https://github.com/daboooo","followers_url":"https://api.github.com/users/daboooo/followers","following_url":"https://api.github.com/users/daboooo/following{/other_user}","gists_url":"https://api.github.com/users/daboooo/gists{/gist_id}","starred_url":"https://api.github.com/users/daboooo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daboooo/subscriptions","organizations_url":"https://api.github.com/users/daboooo/orgs","repos_url":"https://api.github.com/users/daboooo/repos","events_url":"https://api.github.com/users/daboooo/events{/privacy}","received_events_url":"https://api.github.com/users/daboooo/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-18T16:11:29Z","updated_at":"2016-01-21T09:41:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59df0935ac5ea44d2f507499e8b0d8893215e66f","assignee":{"login":"fenrhil","id":412878,"avatar_url":"https://avatars.githubusercontent.com/u/412878?v=3","gravatar_id":"","url":"https://api.github.com/users/fenrhil","html_url":"https://github.com/fenrhil","followers_url":"https://api.github.com/users/fenrhil/followers","following_url":"https://api.github.com/users/fenrhil/following{/other_user}","gists_url":"https://api.github.com/users/fenrhil/gists{/gist_id}","starred_url":"https://api.github.com/users/fenrhil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenrhil/subscriptions","organizations_url":"https://api.github.com/users/fenrhil/orgs","repos_url":"https://api.github.com/users/fenrhil/repos","events_url":"https://api.github.com/users/fenrhil/events{/privacy}","received_events_url":"https://api.github.com/users/fenrhil/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/22/commits","review_comments_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/22/comments","review_comment_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues/22/comments","statuses_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/statuses/61049e3b842226b9b21dcd1408313c8224f7e0d3","head":{"label":"openwide-java:generic-list-items","ref":"generic-list-items","sha":"61049e3b842226b9b21dcd1408313c8224f7e0d3","user":{"login":"openwide-java","id":1385131,"avatar_url":"https://avatars.githubusercontent.com/u/1385131?v=3","gravatar_id":"","url":"https://api.github.com/users/openwide-java","html_url":"https://github.com/openwide-java","followers_url":"https://api.github.com/users/openwide-java/followers","following_url":"https://api.github.com/users/openwide-java/following{/other_user}","gists_url":"https://api.github.com/users/openwide-java/gists{/gist_id}","starred_url":"https://api.github.com/users/openwide-java/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwide-java/subscriptions","organizations_url":"https://api.github.com/users/openwide-java/orgs","repos_url":"https://api.github.com/users/openwide-java/repos","events_url":"https://api.github.com/users/openwide-java/events{/privacy}","received_events_url":"https://api.github.com/users/openwide-java/received_events","type":"Organization","site_admin":false},"repo":{"id":42950514,"name":"owsi-core-parent","full_name":"openwide-java/owsi-core-parent","owner":{"login":"openwide-java","id":1385131,"avatar_url":"https://avatars.githubusercontent.com/u/1385131?v=3","gravatar_id":"","url":"https://api.github.com/users/openwide-java","html_url":"https://github.com/openwide-java","followers_url":"https://api.github.com/users/openwide-java/followers","following_url":"https://api.github.com/users/openwide-java/following{/other_user}","gists_url":"https://api.github.com/users/openwide-java/gists{/gist_id}","starred_url":"https://api.github.com/users/openwide-java/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwide-java/subscriptions","organizations_url":"https://api.github.com/users/openwide-java/orgs","repos_url":"https://api.github.com/users/openwide-java/repos","events_url":"https://api.github.com/users/openwide-java/events{/privacy}","received_events_url":"https://api.github.com/users/openwide-java/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openwide-java/owsi-core-parent","description":"Our Core framework based on Spring, Hibernate and Wicket","fork":false,"url":"https://api.github.com/repos/openwide-java/owsi-core-parent","forks_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/forks","keys_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/teams","hooks_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/hooks","issue_events_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues/events{/number}","events_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/events","assignees_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/assignees{/user}","branches_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/branches{/branch}","tags_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/tags","blobs_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/refs{/sha}","trees_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/statuses/{sha}","languages_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/languages","stargazers_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/stargazers","contributors_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/contributors","subscribers_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/subscribers","subscription_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/subscription","commits_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/commits{/sha}","git_commits_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/commits{/sha}","comments_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/comments{/number}","issue_comment_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues/comments{/number}","contents_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/contents/{+path}","compare_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/merges","archive_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/downloads","issues_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues{/number}","pulls_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls{/number}","milestones_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/milestones{/number}","notifications_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/labels{/name}","releases_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/releases{/id}","created_at":"2015-09-22T17:47:24Z","updated_at":"2016-01-20T15:55:44Z","pushed_at":"2016-01-20T17:24:51Z","git_url":"git://github.com/openwide-java/owsi-core-parent.git","ssh_url":"git@github.com:openwide-java/owsi-core-parent.git","clone_url":"https://github.com/openwide-java/owsi-core-parent.git","svn_url":"https://github.com/openwide-java/owsi-core-parent","homepage":"","size":14245,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":3,"default_branch":"master"}},"base":{"label":"openwide-java:master","ref":"master","sha":"ec0d0ce6e81860740d11d574f414caba68ee6af4","user":{"login":"openwide-java","id":1385131,"avatar_url":"https://avatars.githubusercontent.com/u/1385131?v=3","gravatar_id":"","url":"https://api.github.com/users/openwide-java","html_url":"https://github.com/openwide-java","followers_url":"https://api.github.com/users/openwide-java/followers","following_url":"https://api.github.com/users/openwide-java/following{/other_user}","gists_url":"https://api.github.com/users/openwide-java/gists{/gist_id}","starred_url":"https://api.github.com/users/openwide-java/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwide-java/subscriptions","organizations_url":"https://api.github.com/users/openwide-java/orgs","repos_url":"https://api.github.com/users/openwide-java/repos","events_url":"https://api.github.com/users/openwide-java/events{/privacy}","received_events_url":"https://api.github.com/users/openwide-java/received_events","type":"Organization","site_admin":false},"repo":{"id":42950514,"name":"owsi-core-parent","full_name":"openwide-java/owsi-core-parent","owner":{"login":"openwide-java","id":1385131,"avatar_url":"https://avatars.githubusercontent.com/u/1385131?v=3","gravatar_id":"","url":"https://api.github.com/users/openwide-java","html_url":"https://github.com/openwide-java","followers_url":"https://api.github.com/users/openwide-java/followers","following_url":"https://api.github.com/users/openwide-java/following{/other_user}","gists_url":"https://api.github.com/users/openwide-java/gists{/gist_id}","starred_url":"https://api.github.com/users/openwide-java/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwide-java/subscriptions","organizations_url":"https://api.github.com/users/openwide-java/orgs","repos_url":"https://api.github.com/users/openwide-java/repos","events_url":"https://api.github.com/users/openwide-java/events{/privacy}","received_events_url":"https://api.github.com/users/openwide-java/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openwide-java/owsi-core-parent","description":"Our Core framework based on Spring, Hibernate and Wicket","fork":false,"url":"https://api.github.com/repos/openwide-java/owsi-core-parent","forks_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/forks","keys_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/teams","hooks_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/hooks","issue_events_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues/events{/number}","events_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/events","assignees_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/assignees{/user}","branches_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/branches{/branch}","tags_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/tags","blobs_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/refs{/sha}","trees_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/statuses/{sha}","languages_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/languages","stargazers_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/stargazers","contributors_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/contributors","subscribers_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/subscribers","subscription_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/subscription","commits_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/commits{/sha}","git_commits_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/git/commits{/sha}","comments_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/comments{/number}","issue_comment_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues/comments{/number}","contents_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/contents/{+path}","compare_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/merges","archive_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/downloads","issues_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues{/number}","pulls_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls{/number}","milestones_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/milestones{/number}","notifications_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/labels{/name}","releases_url":"https://api.github.com/repos/openwide-java/owsi-core-parent/releases{/id}","created_at":"2015-09-22T17:47:24Z","updated_at":"2016-01-20T15:55:44Z","pushed_at":"2016-01-20T17:24:51Z","git_url":"git://github.com/openwide-java/owsi-core-parent.git","ssh_url":"git@github.com:openwide-java/owsi-core-parent.git","clone_url":"https://github.com/openwide-java/owsi-core-parent.git","svn_url":"https://github.com/openwide-java/owsi-core-parent","homepage":"","size":14245,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/22"},"html":{"href":"https://github.com/openwide-java/owsi-core-parent/pull/22"},"issue":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues/22"},"comments":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/openwide-java/owsi-core-parent/statuses/61049e3b842226b9b21dcd1408313c8224f7e0d3"}}}}