Class: Group

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/group.rb

Overview

A group represents a collection of permissions. Each User can be assigned to one or more groups, and the sum of their permissions from all groups combined represents what they can do.

Constant Summary collapse

GUEST_CODE =
"guest"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.guestObject

Finds the guest group, which is a special group that represents public non-logged in users.



37
38
39
# File 'app/models/group.rb', line 37

def self.guest
  with_code(GUEST_CODE).first
end

Instance Method Details

#cms_access?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'app/models/group.rb', line 32

def cms_access?
  group_type && group_type.cms_access?
end

#guest?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/models/group.rb', line 28

def guest?
  group_type && group_type.guest?
end