Sha256: 3a8eed0ff3414cfad546bbcdb81ab9062cc755de4dd9ca91cb24f484bb6341dc
Contents?: true
Size: 527 Bytes
Versions: 9
Compression:
Stored size: 527 Bytes
Contents
module RoleAuthorization module Rules class Rule attr_accessor :role, :options attr_accessor :returning # for calls to authorized? attr_accessor :controller_instance, :controller, :action, :id def initialize(role, options, &block) @returning = block @role = role @options = options self end def authorized?(*args) @controller_instance, @controller, @action, @id = args instance_eval(&returning) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems