Sha256: 375b2a41d84e1c852fd2f882979cb90c02dd22c10613a84bc01513913b8cfc2b

Contents?: true

Size: 767 Bytes

Versions: 24

Compression:

Stored size: 767 Bytes

Contents

class UserSubject < Checkin::Subject

      role :guest, :alias => :anonymous do
          !subject_model
      end

      role :logged_in, :alias => [:connected] do
          !!subject_model
      end

      role :owner, :require => [:logged_in], :method => :own do |object|
          object && ( object.respond_to?(:author) && ( subject_model == object.author ) ) ||  ( object.respond_to?(:owner) && ( subject_model == object.owner ) )
      end
      
      role :administrator, :require => :logged_in, :alias => :admin do
          subject_model && subject_model.is_a?(Superuser)
      end

      #
      # Permissions
      #

      # Admin

      scope :admin do
        permissions do
          allow :administrators
          deny
        end
      end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fullstack-admin-0.2.26 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.25 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.24 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.23 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.22 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.21 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.20 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.19 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.18 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.17 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.16 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.15 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.14 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.13 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.12 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.11 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.9 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.8 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.7 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb
fullstack-admin-0.2.6 lib/generators/fullstack/admin/templates/root/lib/support/user_subject.rb