Sha256: d942cac77d8fa4bf913f955e5de1ac4b49303b937c5ba2888b45ccc6f821116b

Contents?: true

Size: 359 Bytes

Versions: 14

Compression:

Stored size: 359 Bytes

Contents

module C2
  class AccessDenied < StandardError
    attr_reader :action, :subject
    attr_writer :default_message

    def initialize(message = nil, subject = nil)
      @message = message
      @subject = subject
      @default_message = "You are not authorized to access this page."
    end

    def to_s
      @message || @default_message
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
c2-0.1.13 lib/c2/exceptions.rb
c2-0.1.12 lib/c2/exceptions.rb
c2-0.1.11 lib/c2/exceptions.rb
c2-0.1.10 lib/c2/exceptions.rb
c2-0.1.9 lib/c2/exceptions.rb
c2-0.1.8 lib/c2/exceptions.rb
c2-0.1.7 lib/c2/exceptions.rb
c2-0.1.6 lib/c2/exceptions.rb
c2-0.1.5 lib/c2/exceptions.rb
c2-0.1.4 lib/c2/exceptions.rb
c2-0.1.3 lib/c2/exceptions.rb
c2-0.1.2 lib/c2/exceptions.rb
c2-0.1.1 lib/c2/exceptions.rb
c2-0.1.0 lib/c2/exceptions.rb