Class: Arkaan::Files::Permission

Inherits:
Object
  • Object
show all
Includes:
Concerns::Enumerable, Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/arkaan/files/permission.rb

Overview

The permission granted to a user to access and/or delete a file.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#accountArkaan::Account

Returns the user being granted the access to the file.

Returns:



21
# File 'lib/arkaan/files/permission.rb', line 21

belongs_to :account, class_name: 'Arkaan::Account', inverse_of: :permissions

#fileArkaan::Files::Document

Returns the document the permission is linked to.

Returns:



18
# File 'lib/arkaan/files/permission.rb', line 18

belongs_to :file, class_name: 'Arkaan::Files::Document', inverse_of: :permissions

#typeSymbol

Returns the type of permission granted (is the user able to delete the file ?).

Returns:

  • (Symbol)

    the type of permission granted (is the user able to delete the file ?)



14
# File 'lib/arkaan/files/permission.rb', line 14

enum_field :type, %i[read read_write]