Class: Faalis::Group

Inherits:
Object
  • Object
show all
Includes:
Concerns::Authorizable, Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/faalis/group.rb

Overview

Group model for Faalis platform

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) policy_class



35
36
37
# File 'app/models/faalis/group.rb', line 35

def self.policy_class
  GroupPolicy
end

Instance Method Details

- (Boolean) include_permission?(perm)

Returns:

  • (Boolean)


39
40
41
42
43
44
45
# File 'app/models/faalis/group.rb', line 39

def include_permission?(perm)
  if perm.is_a? Fixnum
    permission_ids.include? perm
  else
    permission_ids.include? perm.id
  end
end

- (Object) permission_ids (private)



52
53
54
# File 'app/models/faalis/group.rb', line 52

def permission_ids
  @permission_ids ||= permissions.map(&:id)
end

- (Object) to_s



47
48
49
# File 'app/models/faalis/group.rb', line 47

def to_s
  name
end