hydra-access-controls 5.0.0.pre14 → 5.0.0.pre15
Sign up to get free protection for your applications and to get access to all the features.
@@ -28,9 +28,8 @@ module Hydra
|
|
28
28
|
class AccessDenied < ::CanCan::AccessDenied; end
|
29
29
|
|
30
30
|
end
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
require 'role_mapper'
|
31
|
+
|
32
|
+
# Enable the ability/role_mapper classes in the local application to load before the ability/role_mapper classes provided by hydra-access-controls
|
33
|
+
autoload :Ability, 'ability'
|
34
|
+
autoload :RoleMapper, 'role_mapper'
|
36
35
|
|
@@ -29,6 +29,8 @@ module Hydra::AccessControlsEnforcement
|
|
29
29
|
# class CatalogController < ApplicationController
|
30
30
|
# before_filter :enforce_access_controls
|
31
31
|
# end
|
32
|
+
#
|
33
|
+
# @deprecated HYDRA-886 Blacklight is now using Catalog#update to store pagination info, so we don't want to enforce_edit_permissions on it. Instead just call before_filter :enforce_show_permissions, :only=>:show. Move all Edit/Update/Delete methods into non-catalog backed controllers.
|
32
34
|
def enforce_access_controls(opts={})
|
33
35
|
controller_action = params[:action].to_s
|
34
36
|
delegate_method = "enforce_#{controller_action}_permissions"
|
@@ -38,6 +40,7 @@ module Hydra::AccessControlsEnforcement
|
|
38
40
|
true
|
39
41
|
end
|
40
42
|
end
|
43
|
+
deprecation_deprecate :enforce_access_controls
|
41
44
|
|
42
45
|
|
43
46
|
#
|
@@ -142,6 +145,7 @@ module Hydra::AccessControlsEnforcement
|
|
142
145
|
session[:viewing_context] = "edit"
|
143
146
|
end
|
144
147
|
end
|
148
|
+
deprecation_deprecate :enforce_edit_permissions
|
145
149
|
|
146
150
|
## This method is here for you to override
|
147
151
|
def enforce_create_permissions(opts={})
|
@@ -150,6 +154,7 @@ module Hydra::AccessControlsEnforcement
|
|
150
154
|
raise Hydra::AccessDenied.new "You do not have sufficient privileges to create a new document."
|
151
155
|
end
|
152
156
|
end
|
157
|
+
deprecation_deprecate :enforce_edit_permissions
|
153
158
|
|
154
159
|
## proxies to enforce_edit_permssions. This method is here for you to override
|
155
160
|
def enforce_update_permissions(opts={})
|