Sha256: 430463f56d492a690f138a63360fe2ae85cc6cdd4d119e3b4091c5a65d72f2f3

Contents?: true

Size: 598 Bytes

Versions: 3

Compression:

Stored size: 598 Bytes

Contents

#*************************************************************************************
# Control the access using a tag.
#*************************************************************************************
class Portier::ViewTagsPermission < Portier::BasePermission
  def can_view?(tag, options={})
    if self.respond_to? tag.to_sym
      @options = options

      self.send(tag.to_sym)
    else
      raise Portier::NoPermissionError, "You must define the method \"#{tag}\" in the view tags file (app/permissions/view_tags_permission.rb). See documentation for more details."
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
portier-1.1.1 lib/portier/view_tags_permission.rb
portier-1.1.0 lib/portier/view_tags_permission.rb
portier-1.0.3 lib/portier/view_tags_permission.rb