{"action":"created","issue":{"url":"https://api.github.com/repos/api-platform/core/issues/2189","repository_url":"https://api.github.com/repos/api-platform/core","labels_url":"https://api.github.com/repos/api-platform/core/issues/2189/labels{/name}","comments_url":"https://api.github.com/repos/api-platform/core/issues/2189/comments","events_url":"https://api.github.com/repos/api-platform/core/issues/2189/events","html_url":"https://github.com/api-platform/core/issues/2189","id":357085272,"node_id":"MDU6SXNzdWUzNTcwODUyNzI=","number":2189,"title":"Filtering results for users","user":{"login":"trsteel88","id":869933,"node_id":"MDQ6VXNlcjg2OTkzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/869933?v=4","gravatar_id":"","url":"https://api.github.com/users/trsteel88","html_url":"https://github.com/trsteel88","followers_url":"https://api.github.com/users/trsteel88/followers","following_url":"https://api.github.com/users/trsteel88/following{/other_user}","gists_url":"https://api.github.com/users/trsteel88/gists{/gist_id}","starred_url":"https://api.github.com/users/trsteel88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trsteel88/subscriptions","organizations_url":"https://api.github.com/users/trsteel88/orgs","repos_url":"https://api.github.com/users/trsteel88/repos","events_url":"https://api.github.com/users/trsteel88/events{/privacy}","received_events_url":"https://api.github.com/users/trsteel88/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-05T06:38:29Z","updated_at":"2018-09-10T01:11:34Z","closed_at":"2018-09-10T01:11:34Z","author_association":"NONE","body":"I have been looking at Extensions and Filters and I am trying to figure out the best way to limit what users see depending on who they are.\r\n\r\nI am using Security Voters for Items, so I only need to solve what comes through on Collections as the voter will deny access if someone tries to access something they shouldn't.\r\n\r\nI have **Projects**, **Organisations** and **Users**. Projects belong to a user and an organisation, Users can belong to many organisations.\r\n\r\nI have an endpoint for /projects which I can limit the results by using an Extension and only revealing projects for that user.\r\n\r\nHowever, I also need an admin endpoint for projects where I want them to be able to see any project. However, an admin may also have their own projects so I need them to be able to control what they see.\r\n\r\nRather than using an Extension, can I use a filter and check if that user has access to the value they are trying to filter by? This would mean that whenever someone requests /projects they can provide a query value (e.g. /projects?organisation=/api/organisation/1 or leave it empty to show all - /projects).\r\n\r\nHow can I check that user actually has access to that organisation? If the user has a ROLE_ADMIN I want to allow them to use any organisation (or none at all). If they have ROLE_USER they *must* provide a value for organisation and I need my voter to check they belong to the organisation.\r\n"},"comment":{"url":"https://api.github.com/repos/api-platform/core/issues/comments/419760263","html_url":"https://github.com/api-platform/core/issues/2189#issuecomment-419760263","issue_url":"https://api.github.com/repos/api-platform/core/issues/2189","id":419760263,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTc2MDI2Mw==","user":{"login":"trsteel88","id":869933,"node_id":"MDQ6VXNlcjg2OTkzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/869933?v=4","gravatar_id":"","url":"https://api.github.com/users/trsteel88","html_url":"https://github.com/trsteel88","followers_url":"https://api.github.com/users/trsteel88/followers","following_url":"https://api.github.com/users/trsteel88/following{/other_user}","gists_url":"https://api.github.com/users/trsteel88/gists{/gist_id}","starred_url":"https://api.github.com/users/trsteel88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trsteel88/subscriptions","organizations_url":"https://api.github.com/users/trsteel88/orgs","repos_url":"https://api.github.com/users/trsteel88/repos","events_url":"https://api.github.com/users/trsteel88/events{/privacy}","received_events_url":"https://api.github.com/users/trsteel88/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T01:11:34Z","updated_at":"2018-09-10T01:11:34Z","author_association":"NONE","body":"Thanks @soyuka "}}
{"actor":{"display_login":"trsteel88"}}