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.3.7 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.6 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.5 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.4 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.3 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.2 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.1 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.3.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.20 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.19 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.18 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.17 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.16 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.15 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.14 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.13 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.12 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.11 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.10 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-0.2.9 app/controllers/maestrano/account/group_users_controller.rb