Sha256: ad2e6a0d013055e3205a9136739bc4809f662dd034caf3cb1bcf092dc0aa2890

Contents?: true

Size: 814 Bytes

Versions: 21

Compression:

Stored size: 814 Bytes

Contents

class Maestrano::Account::GroupUsersController < Maestrano::Rails::WebHookController

  # DELETE /maestrano/account/groups/cld-1/users/usr-1
  # DELETE /maestrano/account/groups/cld-1/users/usr-1/tenant
  # Remove a user from a group
  def destroy
    # Set the right uid based on Maestrano.param('sso.creation_mode')
    user_uid = Maestrano.mask_user(params[:id], params[:group_id]) 
    group_uid = params[:group_id]
    
    # Get the entities
    user = Maestrano::Connector::Rails::User.find_by_uid_and_tenant(user_uid, params[:tenant] || 'default')
    organization = Maestrano::Connector::Rails::Organization.find_by_uid_and_tenant(group_uid, params[:tenant] || 'default')
    
    # Remove the user from the organization
    organization.remove_member(user)
    
    render json: {success: true}
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
maestrano-connector-rails-1.2.1 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.2.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.1.2 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.1.1 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.1.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.0.4 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.0.3 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.0.2 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.0.1 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.0.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.4.4 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.4.3 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.4.2 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.4.1 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.4.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.13 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.12 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.11 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.10 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.9 app/controllers/maestrano/account/group_users_controller.rb