Sha256: cdf1be3c02693458ee6830231da23451c82746dd9faa1832b16121c9c4ff34d1

Contents?: true

Size: 253 Bytes

Versions: 34

Compression:

Stored size: 253 Bytes

Contents

module Workarea
  module RoutesConstraints
    class SuperAdmin
      def matches?(request)
        user_id = request.cookie_jar.signed[:user_id]
        return false if user_id.blank?
        User.find(user_id).super_admin?
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.45 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.44 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.43 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.42 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.41 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.40 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.39 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.38 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.37 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.36 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.35 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.34 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.33 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.32 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.31 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.30 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.29 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.28 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.27 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.4.26 lib/workarea/routes_constraints/super_admin.rb