Class WordRole
In: app/models/word_role.rb
Parent: ActiveRecord::Base

Methods

Constants

WORD_ROLE_OWNER = 'owner'
WORD_ROLE_EDITOR = 'editor'

Public Class methods

[Source]

    # File app/models/word_role.rb, line 14
14:   def self.get_editor
15:     return WordRole.find_by_role(WORD_ROLE_EDITOR)
16:   end

[Source]

    # File app/models/word_role.rb, line 10
10:   def self.get_owner
11:     return WordRole.find_by_role(WORD_ROLE_OWNER)
12:   end

Public Instance methods

[Source]

    # File app/models/word_role.rb, line 18
18:   def to_label
19:     @role
20:   end

Protected Instance methods

[Source]

    # File app/models/word_role.rb, line 24
24:   def authorized_for_create?
25:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ROOT)
26:   end

[Source]

    # File app/models/word_role.rb, line 32
32:   def authorized_for_destroy?
33:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ROOT)
34:   end

[Source]

    # File app/models/word_role.rb, line 36
36:   def authorized_for_read?
37:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ROOT)
38:   end

[Source]

    # File app/models/word_role.rb, line 28
28:   def authorized_for_update?
29:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ROOT)
30:   end

[Validate]