Sha256: 7031a7215b2017baac688eec0537278d54677d9191652e93e50d1aa8054a8519

Contents?: true

Size: 925 Bytes

Versions: 14

Compression:

Stored size: 925 Bytes

Contents

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

  # DELETE /maestrano/account/groups/cld-1/users/usr-1
  # 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]
    
    # Perform association deletion steps here
    # --
    # If Maestrano.param('sso.creation_mode') is set to virtual
    # then you might want to just delete/cancel/block the user
    #
    # E.g
    # user = User.find_by_provider_and_uid('maestrano',user_uid)
    # organization = Organization.find_by_provider_and_uid('maestrano',group_uid)
    # 
    # if Maestrano.param('sso.creation_mode') == 'virtual'
    #  user.destroy
    # else
    #   organization.remove_user(user)
    #   user.block_access! if user.reload.organizations.empty?
    # end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
maestrano-rails-0.12.0 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.11.0 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.10.0 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.9.5 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.9.4 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-test-0.9.4 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-test-0.9.3 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.9.3 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.9.2 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.9.1 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.9.0 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.8.0 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.7.0 lib/generators/maestrano/templates/group_users_controller.rb
maestrano-rails-0.6.0 lib/generators/maestrano/templates/group_users_controller.rb