Permalink
Browse files

Merge branch 'master' of github.com:mlc/wnetpbcore

  • Loading branch information...
2 parents 88a6dd0 + dcc195c commit 79257baee7f53e6031b47b3c618039bbe17ad645 @Bringo Bringo committed Jan 13, 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.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -8,7 +8,8 @@ def self.up
TABLES.each do |table|
# default for new records is false but exsiting records should be true
add_column table, :visible, :boolean, :null => false, :default => 0
- table.to_s.camelize.singularize.constantize.update_all("visible = 1")
+ # table.to_s.camelize.singularize.constantize.update_all("visible = 1")
+ execute("UPDATE #{table.to_s} SET visible = 1")
end
# lame.
execute("UPDATE identifier_sources SET visible=0 WHERE id=1")
View

Large diffs are not rendered by default.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,52 @@
+/*
+ * WNYC theme-specific style rules
+ */
+
+/* colors */
+a { color: #000; }
+a:hover { color: #508bc7; }
+body { background-color: #262626; }
+
+a.secondaryLink:hover { color: #508bc7; }
+
+.topnavLi li a { color: #ccc; }
+.topnavLi li a:hover { color: #508bc7; }
+
+.topnavuserBar { color: #ccc; }
+.topnavuserBar a { color: #ccc; }
+.topnavuserBar a:hover { color: #508bc7; }
+
+.searchSelected { color: #508bc7; }
+
+.contentTopLinks { color: #666; }
+a.contentTopLinks { color: #ccc; }
+a.contentTopLinks:hover { color: #508bc7; }
+
+a.contentLink { color: #508bc7; }
+a.contentLink:hover { color: #508bc7; }
+
+a.footerLink { color: #ccc; }
+a.footerLink:hover { color: #81afdf; }
+
+a#all_asset_link, a#streamable_asset_link { color: #666; }
+a#all_asset_link:hover, a#streamable_asset_link:hover, a#all_asset_link.selected_option, a#streamable_asset_link.selected_option { color: #508bc7; }
+
+.contentTopLinksArea a { color: #D6D6D6; }
+
+/* images */
+.topnavBar { background-image: url(/images/mpr/template/topnavBg.jpg); }
+.topnavuserBar { background-image: url(/images/mpr/template/topnavuserBg.jpg); }
+.sidebarTop { background-image: url(/images/mpr/template/sidebarTop.jpg); }
+.sidebarMiddle { background-image: url(/images/mpr/template/sidebarBg.jpg); }
+.sidebarSearch { background-image: url(/images/mpr/template/sidebarBg.jpg); }
+.sidebarBottom { background-image: url(/images/mpr/template/sidebarBottom.jpg); }
+.contentTop { background-image: url(/images/mpr/template/contentTop.jpg); }
+.contentMiddle { background-image: url(/images/mpr/template/contentBg.jpg); }
+.contentDivider { background-image: url(/images/mpr/template/contentDivider.jpg); }
+.contentBottom { background-image: url(/images/mpr/template/contentBottom.jpg); }
+.header { background-image: url(/images/mpr/template/header.png); }
+.holder { background-image: url(/images/mpr/template/bg_color.jpg); }
+
+a#all_asset_link { background:transparent url(/images/mpr/buttons/btnAssets.png) 0 -2px no-repeat; }
+a#streamable_asset_link { background:transparent url(/images/mpr/buttons/btnStreamable.png) 0 -2px no-repeat; }
+

0 comments on commit 79257ba

Please sign in to comment.