Class: Core::Models::Permissions::Group

Inherits:
Object
  • Object
show all
Includes:
Concerns::Sluggable, Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/core/models/permissions/group.rb

Overview

A group gathers one or several users to give them the same rights for conviniency purposes.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#accounts ⇒ Array<Core::Models::Account>

Returns the accounts having the rights granted by this group.

Returns:



20
# File 'lib/core/models/permissions/group.rb', line 20

has_and_belongs_to_many :accounts, class_name: 'Core::Models::Account', inverse_of: :groups

#is_default ⇒ Boolean

Returns a boolean indicating whether this group is given when a new user registered or not.

Returns:

  • (Boolean) —

    a boolean indicating whether this group is given when a new user registered or not.



13
# File 'lib/core/models/permissions/group.rb', line 13

field :is_default, type: Boolean, default: false

#is_superuser ⇒ Boolean

Returns a boolean indicating whether this group should have access to all groups and rights or not.

Returns:

  • (Boolean) —

    a boolean indicating whether this group should have access to all groups and rights or not.



16
# File 'lib/core/models/permissions/group.rb', line 16

field :is_superuser, type: Boolean, default: false

#rights ⇒ Array<Core::Models::Permissions::Right>

Returns the rights granted by belonging to this group.

Returns:



23
# File 'lib/core/models/permissions/group.rb', line 23

has_and_belongs_to_many :rights, class_name: 'Core::Models::Permissions::Right', inverse_of: :groups

#routes ⇒ Array<Core::Models::Monitoring::Route>

Returns the routes this group can access in the API.

Returns:



26
# File 'lib/core/models/permissions/group.rb', line 26

has_and_belongs_to_many :routes, class_name: 'Core::Models::Monitoring::Route', inverse_of: :groups