Class: Core::Models::Files::Permission

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

#accountCore::Models::Account

Returns the user being granted the access to the file.

Returns:



22
# File 'lib/core/models/files/permission.rb', line 22

belongs_to :account, class_name: 'Core::Models::Account', inverse_of: :permissions

#fileCore::Models::Files::Document

Returns the document the permission is linked to.

Returns:



19
# File 'lib/core/models/files/permission.rb', line 19

belongs_to :file, class_name: 'Core::Models::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 ?)



15
# File 'lib/core/models/files/permission.rb', line 15

enum_field :type, [:read, :read_write]