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.27 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.26 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.25 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.23 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.22 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.21 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.20 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.19 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.18 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.17 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.16 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.15 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.14 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.13 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.12 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.11 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.10 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.9 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.8 lib/workarea/routes_constraints/super_admin.rb
workarea-core-3.5.7 lib/workarea/routes_constraints/super_admin.rb