Permalink
Browse files

moving seed data out of migrations

  • Loading branch information...
1 parent f3ccdce commit c15d5b3e10a3e881d46e92f65285947a31c564bf @Bringo Bringo committed Jan 11, 2012
View
@@ -0,0 +1,65 @@
+authorization do
+ role :guest do
+ # no permissions
+ end
+
+ role :user do
+ includes :guest
+ has_permission_on :assets, :to => [:read, :request, :history, :diff]
+ has_permission_on :instantiations, :to => [:read]
+ has_permission_on :users, :to => [:show, :update] do
+ if_attribute :id => is { user.id }
+ end
+ end
+
+ role :cataloger do
+ includes :user
+ has_permission_on :assets, :to => [:create]
+ has_permission_on :assets, :to => [:update, :delete] do
+ if_attribute :creator_id => is { user.id }
+ end
+ has_permission_on :subjects, :to => [:read]
+ has_permission_on :instantiatons, :to => [:create]
+ has_permission_on :instantiations, :to => [:update, :delete] do
+ if_attribute :creator_id => is { user.id }
+ end
+ end
+
+ role :editor do
+ includes :user
+ has_permission_on :assets, :to => :crud
+ has_permission_on :instantiations, :to => :crud
+ has_permission_on :subjects, :to => [:crud]
+ end
+
+ role :admin do
+ includes :editor
+ has_permission_on :last_used_ids, :to => :index
+ has_permission_on :templates, :to => :crud
+ has_permission_on :users, :to => :crud
+ has_permission_on :users, :to => :make_admin do
+ if_attribute :id => is_not { user.id }
+ end
+ has_permission_on :picklists, :to => :crud
+ (PicklistsController::SUBCLASSES - ['subjects']).each do |kl|
+ has_permission_on kl.to_sym, :to => :crud
+ end
+ has_permission_on :assets, :to => :multilend
+ has_permission_on :assets, :to => :destroy_found_set
+ has_permission_on :assets, :to => :replace
+ has_permission_on :ip_blocks, :to => :crud
+ has_permission_on :value_lists, :to => :crud
+ has_permission_on :reports, :to => :index
+ end
+end
+
+privileges do
+ privilege :read, :includes => [:index, :show]
+ privilege :create, :includes => :new
+ privilege :update, :includes => :edit
+ privilege :borrow, :includes => [:borrowings, :return]
+ privilege :crud, :includes => [:create, :read, :update, :destroy]
+ privilege :merge, :includes => :multiprocess
+ privilege :video, :includes => [:upload_video, :thumbnail, :upload_thumbnail]
+ privilege :replace, :includes => :do_replace
+end
View
0 config/auth_rules/wnyc.rb 100755 → 100644
No changes.
Oops, something went wrong.

0 comments on commit c15d5b3

Please sign in to comment.