Sha256: 11861db3a20e69628906f77be7d7d0793e59351c13faad51a79296befed51e1f
Contents?: true
Size: 511 Bytes
Versions: 18
Compression:
Stored size: 511 Bytes
Contents
module Itsf::Backend class EnginePolicy < Struct.new(:user, :engine) def access? permission_identifier = self.class.name.gsub('Policy', '').underscore allowed = user.respond_to?(:allowed_to?) ? user.allowed_to?(permission_identifier) : false if allowed Rails.logger.debug "User #{user} is allowed to access #{permission_identifier}" else Rails.logger.debug "User #{user} is not allowed to access #{permission_identifier}" end allowed end end end
Version data entries
18 entries across 18 versions & 1 rubygems