Module: LabClient::AccessLevel

Included in:
Common, GroupLink, Member, Membership
Defined in:
lib/labclient/access_levels.rb

Overview

Shared Methods

Constant Summary collapse

HUMAN_ACCESS_LEVELS =
{
  0 => :none,
  10 => :guest,
  20 => :reporter,
  30 => :developer,
  40 => :maintainer,
  50 => :owner,
  60 => :admin
}.freeze
MACHINE_ACCESS_LEVELS =
{
  none: 0,
  guest: 10,
  reporter: 20,
  developer: 30,
  maintainer: 40,
  owner: 50,
  admin: 60
}.freeze

Instance Method Summary collapse

Instance Method Details

#human_access_level(level = 10) ⇒ Object



25
26
27
# File 'lib/labclient/access_levels.rb', line 25

def human_access_level(level = 10)
  HUMAN_ACCESS_LEVELS[level]
end

#human_protected_access_level(level = 10) ⇒ Object



37
38
39
# File 'lib/labclient/access_levels.rb', line 37

def human_protected_access_level(level = 10)
  HUMAN_ACCESS_LEVELS[level]
end

#machine_access_level(level = :developer) ⇒ Object



29
30
31
# File 'lib/labclient/access_levels.rb', line 29

def machine_access_level(level = :developer)
  MACHINE_ACCESS_LEVELS[level]
end

#machine_protected_access_level(level = :developer) ⇒ Object



33
34
35
# File 'lib/labclient/access_levels.rb', line 33

def machine_protected_access_level(level = :developer)
  MACHINE_ACCESS_LEVELS[level]
end