Sha256: fead2eb519687e69558a0abc18e47a7f892c2c2c4c7f0a42206b0c5bb58d5f36
Contents?: true
Size: 723 Bytes
Versions: 2
Compression:
Stored size: 723 Bytes
Contents
module Arpa module Services class Verifier def initialize(session, current_user) @session = session @current_user = current_user end def has_access?(resource, action) free_access_action = action.to_s.split('_')[0] return true if free_access_action.empty? @session[:entity_permissions] ||= action_finder.permissions(@current_user.profile_ids) @session[:entity_permissions].has_permission?(resource.to_s, action.to_s) end def reset_permissions @session[:entity_permissions] = nil end private def action_finder @action_finder ||= Arpa::Repositories::Actions::Finder.new end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
arpa-0.0.6 | lib/arpa/services/verifier.rb |
arpa-0.0.5 | lib/arpa/services/verifier.rb |