Class: Webhookdb::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/webhookdb/role.rb

Class Method Summary collapse

Class Method Details

.admin_roleObject

n.b. Because of the uniqueness constraint on “name”, there is only one “admin” role. Its meaning depends on the context: if the customer has this role, they are an admin; if the org membership has this role, the customer is an org admin.



11
12
13
14
15
# File 'lib/webhookdb/role.rb', line 11

def self.admin_role
  return Webhookdb.cached_get("role_admin") do
    self.find_or_create_or_find(name: "admin")
  end
end

.non_admin_roleObject



17
18
19
20
21
# File 'lib/webhookdb/role.rb', line 17

def self.non_admin_role
  return Webhookdb.cached_get("role_member") do
    self.find_or_create_or_find(name: "member")
  end
end