Sha256: 35a5eb22a65298a69c5c50fa7122ba0408f53fb6b3450febae194e883329858e
Contents?: true
Size: 605 Bytes
Versions: 17
Compression:
Stored size: 605 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.try_all(*Itsf::Backend.resource_title_methods)} is allowed to access #{permission_identifier}" else Rails.logger.debug "User #{user.try_all(*Itsf::Backend.resource_title_methods)} is not allowed to access #{permission_identifier}" end allowed end end end
Version data entries
17 entries across 17 versions & 1 rubygems