Sha256: 5c6c9eb5597abfae85da01cd980842caa4e9bf578d6f1f601dd7db4f9fd16c7f
Contents?: true
Size: 500 Bytes
Versions: 46
Compression:
Stored size: 500 Bytes
Contents
module Itsf::Backend class DashboardPolicy < Struct.new(:user, :dashboard) def access? permission_identifier = self.class.name.gsub('Policy', '').underscore allowed = user.respond_to?(:allowed_to?) ? user.allowed_to?(permission_identifier) : true if allowed Rails.logger.info "Allowed access to #{permission_identifier} for #{user}" else Rails.logger.info "Denied access to #{permission_identifier} for #{user}" end allowed end end end
Version data entries
46 entries across 46 versions & 1 rubygems