Class: Guide::DefaultAuthorisationSystem

Inherits:
Object
  • Object
show all
Defined in:
app/models/guide/default_authorisation_system.rb

Instance Method Summary collapse

Instance Method Details

#allow?(action) ⇒ Boolean

Returns:

  • (Boolean)

2
3
4
# File 'app/models/guide/default_authorisation_system.rb', line 2

def allow?(action)
  true
end

#user_is_privileged?Boolean

Returns:

  • (Boolean)

6
7
8
9
# File 'app/models/guide/default_authorisation_system.rb', line 6

def user_is_privileged?
  allow?(:view_guide_unpublished) ||
    allow?(:view_guide_restricted)
end

#valid_visibility_optionsObject


11
12
13
14
15
16
17
# File 'app/models/guide/default_authorisation_system.rb', line 11

def valid_visibility_options
  [
    nil,
    :unpublished,
    :restricted,
  ]
end