services/api/app/models/user.rb
def unsetup
    # delete oid_login_perms for this user
    Link.where(tail_uuid: self.email,
                     link_class: 'permission',
                     name: 'can_login').destroy_all

    # delete repo_perms for this user
    Link.where(tail_uuid: self.uuid,
                     link_class: 'permission',
                     name: 'can_manage').destroy_all

    # delete vm_login_perms for this user
    Link.where(tail_uuid: self.uuid,
                     link_class: 'permission',
                     name: 'can_login').destroy_all

    # delete "All users" group read permissions for this user
    group = Group.where(name: 'All users').select do |g|
      g[:uuid].match(/-f+$/)
    end.first
    Link.where(tail_uuid: self.uuid,
                     head_uuid: group[:uuid],
                     link_class: 'permission',
                     name: 'can_read').destroy_all

    # delete any signatures by this user
    Link.where(link_class: 'signature',
                     tail_uuid: self.uuid).destroy_all

    # delete user preferences (including profile)
    self.prefs = {}

    # mark the user as inactive
    self.is_active = false
    self.save!
  end
# delete user signatures, login, repo, and vm perms, and mark as inactive
delete user signatures, login, repo, and vm perms, and mark as inactive
delete user signatures login repo and vm perms and mark as inactive
def unsetup
    Link.where(tail_uuid: self.email,
                     link_class: 'permission',
                     name: 'can_login').destroy_all
    Link.where(tail_uuid: self.uuid,
                     link_class: 'permission',
                     name: 'can_manage').destroy_all
    Link.where(tail_uuid: self.uuid,
                     link_class: 'permission',
                     name: 'can_login').destroy_all
    group = Group.where(name: 'All users').select do |g|
      g[:uuid].match(/-f+$/)
    end.first
    Link.where(tail_uuid: self.uuid,
                     head_uuid: group[:uuid],
                     link_class: 'permission',
                     name: 'can_read').destroy_all
    Link.where(link_class: 'signature',
                     tail_uuid: self.uuid).destroy_all
    self.prefs = {}
    self.is_active = false
    self.save!
  end
def unsetup Link . where ( tail_uuid : self . email , link_class : 'permission' , name : 'can_login' ) . destroy_all Link . where ( tail_uuid : self . uuid , link_class : 'permission' , name : 'can_manage' ) . destroy_all Link . where ( tail_uuid : self . uuid , link_class : 'permission' , name : 'can_login' ) . destroy_all group = Group . where ( name : 'All users' ) . select do | g | g [ :uuid ] . match ( / -f+$ / ) end . first Link . where ( tail_uuid : self . uuid , head_uuid : group [ :uuid ] , link_class : 'permission' , name : 'can_read' ) . destroy_all Link . where ( link_class : 'signature' , tail_uuid : self . uuid ) . destroy_all self . prefs = { } self . is_active = false self . save! end
delete user signatures, login, repo, and vm perms, and mark as inactive
delete user signatures login repo and vm perms and mark as inactive
# delete oid_login_perms for this user # delete repo_perms for this user # delete vm_login_perms for this user # delete "All users" group read permissions for this user # delete any signatures by this user # delete user preferences (including profile) # mark the user as inactive