{"action":"opened","issue":{"url":"https://api.github.com/repos/anandtpatel/.NETCore/issues/7","repository_url":"https://api.github.com/repos/anandtpatel/.NETCore","labels_url":"https://api.github.com/repos/anandtpatel/.NETCore/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/anandtpatel/.NETCore/issues/7/comments","events_url":"https://api.github.com/repos/anandtpatel/.NETCore/issues/7/events","html_url":"https://github.com/anandtpatel/.NETCore/issues/7","id":175907500,"number":7,"title":"User add (POST)","user":{"login":"qu0253","id":15673981,"avatar_url":"https://avatars.githubusercontent.com/u/15673981?v=3","gravatar_id":"","url":"https://api.github.com/users/qu0253","html_url":"https://github.com/qu0253","followers_url":"https://api.github.com/users/qu0253/followers","following_url":"https://api.github.com/users/qu0253/following{/other_user}","gists_url":"https://api.github.com/users/qu0253/gists{/gist_id}","starred_url":"https://api.github.com/users/qu0253/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qu0253/subscriptions","organizations_url":"https://api.github.com/users/qu0253/orgs","repos_url":"https://api.github.com/users/qu0253/repos","events_url":"https://api.github.com/users/qu0253/events{/privacy}","received_events_url":"https://api.github.com/users/qu0253/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-09T01:49:22Z","updated_at":"2016-09-09T01:49:22Z","closed_at":null,"body":"**Existing site**\r\nNote: User can be linked to many companies\r\n\r\n_logged-in user - needs to have authorization for \"edit\" access \" for \"Users\" module_\r\n_create new user model object (lets say User) with submited values_\r\n_assign/associate account with current account to User object_\r\n_Set password and password_confirmation with genrated random secure hash of 5 chars length if submitted password field is empty to User.password_\r\n\r\n_if company selected through drop down_\r\n> Set User.companies with currently selected company\r\nSet User as company user by setting User.company_user = true \r\n\r\n_else_\r\n > _if all_companies is submitted as 1_\r\n> > Set User.companies to all current account companies\r\n\r\n > _else if some companies were selected through checkbox_\r\n> > Loop through all checked companies ids sent in post params (let say 1,2,3 were sent)\r\n        Filter company ids associated to current account (lets say only 1 and 3 were linked to current account)\r\n         Set User.companies to all filters company ids (so just link 1 and 3)\r\n        \r\n > end\r\n\r\nend\r\n\r\nif User.save was successful\r\n>      mailer = GenericMailer\r\n      mailer = UtterMetricsMailer if current_account.account_type == \"Individual\"\r\n      mailer.new_user_email(current_account, @user).deliver\r\n\r\n      flash[:success] = \"The user has been created.\"\r\n      redirect_to(:action => :index)\r\n\r\nelse\r\n>      \r\n      _if company selected through drop down_\r\n> >      get list of roles for company\r\n        show company/users/new.html.erb\r\n\r\n      else\r\n        @companies = current_account.companies.active.order(\"name ASC\")\r\n        render(:action => :new)\r\n      end\r\n    end\r\n  end"}}
{"actor":{"display_login":"qu0253"}}