{"action":"created","issue":{"url":"https://api.github.com/repos/CasaLaguna/silverstripe-security/issues/15","repository_url":"https://api.github.com/repos/CasaLaguna/silverstripe-security","labels_url":"https://api.github.com/repos/CasaLaguna/silverstripe-security/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/CasaLaguna/silverstripe-security/issues/15/comments","events_url":"https://api.github.com/repos/CasaLaguna/silverstripe-security/issues/15/events","html_url":"https://github.com/CasaLaguna/silverstripe-security/issues/15","id":151163647,"number":15,"title":"Move all Security.php methods to a Trait","user":{"login":"axyr","id":345155,"avatar_url":"https://avatars.githubusercontent.com/u/345155?v=3","gravatar_id":"","url":"https://api.github.com/users/axyr","html_url":"https://github.com/axyr","followers_url":"https://api.github.com/users/axyr/followers","following_url":"https://api.github.com/users/axyr/following{/other_user}","gists_url":"https://api.github.com/users/axyr/gists{/gist_id}","starred_url":"https://api.github.com/users/axyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axyr/subscriptions","organizations_url":"https://api.github.com/users/axyr/orgs","repos_url":"https://api.github.com/users/axyr/repos","events_url":"https://api.github.com/users/axyr/events{/privacy}","received_events_url":"https://api.github.com/users/axyr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-26T15:20:39Z","updated_at":"2016-05-03T07:12:44Z","closed_at":null,"body":"Right now, if you want to use Security features for Frontend Visitors, you have the option to : \r\n\r\n1. Use the Security Controller\r\n2. Build you own if you want to have that same functions in a custom page that lives in the SiteTree\r\n\r\nThe use of Security.php is pretty limited when you need to use Translatable or if you want to customise aspects of how the controller should work.\r\n\r\nIf you want to have features like LostPasswordForm, login etc, on a MyPage class, that involves a lot of copying logic from Security.php.\r\n\r\nIf all the login methods live in a Trait, we could easily drop in the features in a PageType en overload some methods that should behave different.\r\n"},"comment":{"url":"https://api.github.com/repos/CasaLaguna/silverstripe-security/issues/comments/216455732","html_url":"https://github.com/CasaLaguna/silverstripe-security/issues/15#issuecomment-216455732","issue_url":"https://api.github.com/repos/CasaLaguna/silverstripe-security/issues/15","id":216455732,"user":{"login":"axyr","id":345155,"avatar_url":"https://avatars.githubusercontent.com/u/345155?v=3","gravatar_id":"","url":"https://api.github.com/users/axyr","html_url":"https://github.com/axyr","followers_url":"https://api.github.com/users/axyr/followers","following_url":"https://api.github.com/users/axyr/following{/other_user}","gists_url":"https://api.github.com/users/axyr/gists{/gist_id}","starred_url":"https://api.github.com/users/axyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axyr/subscriptions","organizations_url":"https://api.github.com/users/axyr/orgs","repos_url":"https://api.github.com/users/axyr/repos","events_url":"https://api.github.com/users/axyr/events{/privacy}","received_events_url":"https://api.github.com/users/axyr/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T07:12:44Z","updated_at":"2016-05-03T07:12:44Z","body":"Yes, but you can drop in the Trait with all the methods in the Security Controller?\r\nSure you can copy a lot from Security to your MyCustomLoginPage. but it sill results in a lot of code duplication..."}}