Sha256: dd5c906f45498d25a5cacb166d51b3eb7b55164809d9f07961ab1425ccd0aada
Contents?: true
Size: 637 Bytes
Versions: 15
Compression:
Stored size: 637 Bytes
Contents
module License class Base attr_reader :permit def initialize permit @permit = permit end def enforce! raise "enforce! must be implemented by subclass of License::Base" end def can(action, subject, conditions = nil, &block) permit.can action, subject, conditions, &block end def cannot(action, subject, conditions = nil, &block) permit.cannot action, subject, conditions, &block end def owns(user, clazz, ownership_relation = :user_id, user_id_attribute = :id) permit.owns user, clazz, ownership_relation, user_id_attribute end end end
Version data entries
15 entries across 15 versions & 1 rubygems