Class: Virtuaservices::Permissions::Group

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps, Concerns::Sluggable
Defined in:
lib/virtuaservices/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

#accountsArray<Virtuaservices::Account>

Returns the accounts having the rights granted by this group.

Returns:



19
# File 'lib/virtuaservices/permissions/group.rb', line 19

has_and_belongs_to_many :accounts, class_name: 'Virtuaservices::Account', inverse_of: :groups

#is_defaultBoolean

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.



12
# File 'lib/virtuaservices/permissions/group.rb', line 12

field :is_default, type: Boolean, default: false

#is_superuserBoolean

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.



15
# File 'lib/virtuaservices/permissions/group.rb', line 15

field :is_superuser, type: Boolean, default: false

#rightsArray<Virtuaservices::Permissions::Right>

Returns the rights granted by belonging to this group.

Returns:



22
# File 'lib/virtuaservices/permissions/group.rb', line 22

has_and_belongs_to_many :rights, class_name: 'Virtuaservices::Permissions::Right', inverse_of: :groups

#routesArray<Virtuaservices::Monitoring::Route>

Returns the routes this group can access in the API.

Returns:



25
# File 'lib/virtuaservices/permissions/group.rb', line 25

has_and_belongs_to_many :routes, class_name: 'Virtuaservices::Monitoring::Route', inverse_of: :groups