Class: Arkaan::Permissions::Group

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

Returns the accounts having the rights granted by this group.

Returns:

  • (Array<Arkaan::Account>)

    the accounts having the rights granted by this group.



21
# File 'lib/arkaan/permissions/group.rb', line 21

has_and_belongs_to_many :accounts, class_name: 'Arkaan::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.



14
# File 'lib/arkaan/permissions/group.rb', line 14

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.



17
# File 'lib/arkaan/permissions/group.rb', line 17

field :is_superuser, type: Boolean, default: false

#rightsArray<Arkaan::Permissions::Right>

Returns the rights granted by belonging to this group.

Returns:



24
# File 'lib/arkaan/permissions/group.rb', line 24

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

#routesArray<Arkaan::Monitoring::Route>

Returns the routes this group can access in the API.

Returns:



27
# File 'lib/arkaan/permissions/group.rb', line 27

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