Class: Arkaan::Campaigns::Files::Permission

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

Overview

A file permission is the permission given by the creator of the file to another player to access it.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#fileArkaan::Campaigns::File

Returns the file on which the permissions are granted.

Returns:



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

belongs_to :file, class_name: 'Arkaan::Campaigns::File', inverse_of: :permissions

#invitationArkaan::Campaigns::Invitation

Returns the invitation of the player in the campaign where this file was uploaded.

Returns:



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

belongs_to :invitation, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :permissions

#statusSymbol

Returns the current level of permission for the linked user on the linked file.

Returns:

  • (Symbol)

    the current level of permission for the linked user on the linked file.



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

enum_field :level, [:creator, :read], default: :read