{"action":"created","issue":{"url":"https://api.github.com/repos/SUSE/Portus/issues/102","labels_url":"https://api.github.com/repos/SUSE/Portus/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/SUSE/Portus/issues/102/comments","events_url":"https://api.github.com/repos/SUSE/Portus/issues/102/events","html_url":"https://github.com/SUSE/Portus/issues/102","id":87337535,"number":102,"title":"Force that there always has to be an admin user","user":{"login":"mssola","id":767943,"avatar_url":"https://avatars.githubusercontent.com/u/767943?v=3","gravatar_id":"","url":"https://api.github.com/users/mssola","html_url":"https://github.com/mssola","followers_url":"https://api.github.com/users/mssola/followers","following_url":"https://api.github.com/users/mssola/following{/other_user}","gists_url":"https://api.github.com/users/mssola/gists{/gist_id}","starred_url":"https://api.github.com/users/mssola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mssola/subscriptions","organizations_url":"https://api.github.com/users/mssola/orgs","repos_url":"https://api.github.com/users/mssola/repos","events_url":"https://api.github.com/users/mssola/events{/privacy}","received_events_url":"https://api.github.com/users/mssola/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SUSE/Portus/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/SUSE/Portus/labels/ux","name":"ux","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"mssola","id":767943,"avatar_url":"https://avatars.githubusercontent.com/u/767943?v=3","gravatar_id":"","url":"https://api.github.com/users/mssola","html_url":"https://github.com/mssola","followers_url":"https://api.github.com/users/mssola/followers","following_url":"https://api.github.com/users/mssola/following{/other_user}","gists_url":"https://api.github.com/users/mssola/gists{/gist_id}","starred_url":"https://api.github.com/users/mssola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mssola/subscriptions","organizations_url":"https://api.github.com/users/mssola/orgs","repos_url":"https://api.github.com/users/mssola/repos","events_url":"https://api.github.com/users/mssola/events{/privacy}","received_events_url":"https://api.github.com/users/mssola/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SUSE/Portus/milestones/4","html_url":"https://github.com/SUSE/Portus/milestones/1st%20stable%20release%20of%20Portus","labels_url":"https://api.github.com/repos/SUSE/Portus/milestones/4/labels","id":1104465,"number":4,"title":"1st stable release of Portus","description":"","creator":{"login":"flavio","id":22728,"avatar_url":"https://avatars.githubusercontent.com/u/22728?v=3","gravatar_id":"","url":"https://api.github.com/users/flavio","html_url":"https://github.com/flavio","followers_url":"https://api.github.com/users/flavio/followers","following_url":"https://api.github.com/users/flavio/following{/other_user}","gists_url":"https://api.github.com/users/flavio/gists{/gist_id}","starred_url":"https://api.github.com/users/flavio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flavio/subscriptions","organizations_url":"https://api.github.com/users/flavio/orgs","repos_url":"https://api.github.com/users/flavio/repos","events_url":"https://api.github.com/users/flavio/events{/privacy}","received_events_url":"https://api.github.com/users/flavio/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":13,"state":"open","created_at":"2015-05-11T09:53:16Z","updated_at":"2015-06-11T12:57:37Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-06-11T12:57:37Z","updated_at":"2015-06-11T13:03:38Z","closed_at":null,"body":"Imagine the following situation:\r\n\r\n1. There are no users in our system, and we create a new admin.\r\n2. Go to the admin page and click the \"Users\" container.\r\n3. Update the current admin user to not be an admin user.\r\n4. Now there are no admin users.\r\n\r\nEven though this might be proper behavior, it's unexpected. I propose two solutions:\r\n\r\n1. Don't allow to remove admin rights to the last admin.\r\n2. Cleaner solution imho: don't allow a user to \"un-admin\" itself. This would protect the user from making any mistakes. Therefore, it should be another admin user the one to \"un-admin\" this user. This way, we make sure that there's always an admin in the system, and that stupid mistakes cannot happen."},"comment":{"url":"https://api.github.com/repos/SUSE/Portus/issues/comments/111124928","html_url":"https://github.com/SUSE/Portus/issues/102#issuecomment-111124928","issue_url":"https://api.github.com/repos/SUSE/Portus/issues/102","id":111124928,"user":{"login":"flavio","id":22728,"avatar_url":"https://avatars.githubusercontent.com/u/22728?v=3","gravatar_id":"","url":"https://api.github.com/users/flavio","html_url":"https://github.com/flavio","followers_url":"https://api.github.com/users/flavio/followers","following_url":"https://api.github.com/users/flavio/following{/other_user}","gists_url":"https://api.github.com/users/flavio/gists{/gist_id}","starred_url":"https://api.github.com/users/flavio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flavio/subscriptions","organizations_url":"https://api.github.com/users/flavio/orgs","repos_url":"https://api.github.com/users/flavio/repos","events_url":"https://api.github.com/users/flavio/events{/privacy}","received_events_url":"https://api.github.com/users/flavio/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T13:03:38Z","updated_at":"2015-06-11T13:03:38Z","body":"I have slight preference for the 2nd one."}}