Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
moving seed data out of migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Trautmann committed Jan 11, 2012
1 parent f3ccdce commit c15d5b3
Show file tree
Hide file tree
Showing 5 changed files with 446 additions and 379 deletions.
65 changes: 65 additions & 0 deletions config/auth_rules/mpr.rb
@@ -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
Empty file modified config/auth_rules/wnyc.rb 100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion config/deploy

0 comments on commit c15d5b3

Please sign in to comment.