Module: LabClient::AccessLevel

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

Overview

Shared Methods

Instance Method Summary collapse

Instance Method Details

#human_access_level(level = 10) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/labclient/access_levels.rb', line 5

def human_access_level(level = 10)
  case level
  when 0 then :none
  when 10 then :guest
  when 20 then :reporter
  when 30 then :developer
  when 40 then :maintainer
  when 50 then :owner
  when 60 then :admin
  end
end

#human_protected_access_level(level = 10) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/labclient/access_levels.rb', line 38

def human_protected_access_level(level = 10)
  case level
  when 0 then :none
  when 30 then :developer
  when 40 then :maintainer
  when 60 then :admin
  end
end

#machine_access_level(level = :developer) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/labclient/access_levels.rb', line 17

def machine_access_level(level = :developer)
  case level
  when :none then 0
  when :guest then 10
  when :reporter then 20
  when :developer then 30
  when :maintainer then 40
  when :owner then 50
  when :admin then 60
  end
end

#machine_protected_access_level(level = :developer) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/labclient/access_levels.rb', line 29

def machine_protected_access_level(level = :developer)
  case level
  when :none then 0
  when :developer then 30
  when :maintainer then 40
  when :admin then 60
  end
end