Sha256: 8f41c32b72e33ea887defe94317f585e8a8d8a76f47f9e42953f37042d001522

Contents?: true

Size: 243 Bytes

Versions: 28

Compression:

Stored size: 243 Bytes

Contents

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-core-3.5.6 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.5 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.4 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.3 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.2 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.1 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.0 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.0.beta.1 lib/workarea/routes_constraints/super_admin.rb