module WarpEngine::AccessPolicy
Decides who may see a title and who may download it. The policy is an object with three methods (visible_software_scope, access_for, authorize_download), set with access_policy in the configuration; the default is AccessPolicy::Open.
Public Class Methods
Source
# File lib/warp_engine/access.rb, line 31 def current configured = WarpEngine.config.access_policy case configured when nil, :open, "open" then open_policy else configured end end
Returns the configured policy object; nil, :open or "open" give the shared Open instance.
Source
# File lib/warp_engine/access.rb, line 41 def open? = current.is_a?(Open)
Returns true when the current policy is Open.
Source
# File lib/warp_engine/access.rb, line 44 def open_policy @open_policy ||= Open.new end
Returns the memoized Open instance.