Sha256: 2a297c5461a9c74404f49a98ae87bf972c014cd563132bc597890f5148eb9af8

Contents?: true

Size: 782 Bytes

Versions: 28

Compression:

Stored size: 782 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 = User.find_by_provider_and_uid_and_tenant('maestrano', user_uid, params[:tenant])
    organization = Organization.find_by_provider_and_uid_and_tenant('maestrano', group_uid, params[:tenant])
    
    # Remove the user from the organization
    organization.remove_member(user)
    
    render json: {success: true}
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
maestrano-connector-rails-0.2.8 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.7 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.5 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.4 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.3 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.2 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.0.1 app/controllers/maestrano/account/group_users_controller.rb