hydra-access-controls 5.0.0.pre1 → 5.0.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
@@ -167,7 +167,7 @@ module Hydra::AccessControlsEnforcement
167
167
  #
168
168
  # @example This method should be added to your Catalog Controller's solr_search_params_logic
169
169
  # class CatalogController < ApplicationController
170
- # include Hydra::Catalog
170
+ # include Hydra::Controller::ControllerBehavior
171
171
  # CatalogController.solr_search_params_logic << :add_access_controls_to_solr_params
172
172
  # end
173
173
  def add_access_controls_to_solr_params(solr_parameters, user_parameters)
@@ -1,4 +1,4 @@
1
- class Rails
1
+ module Rails
2
2
  def self.env
3
3
  ENV['environment']
4
4
  end
@@ -7,4 +7,7 @@ class Rails
7
7
  "0.0.0"
8
8
  #"hydra-access-controls mock rails"
9
9
  end
10
+ def self.root
11
+ 'spec/support'
12
+ end
10
13
  end
@@ -2,9 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe Ability do
4
4
  before do
5
- class Rails; end
6
- Rails.stub(:root).and_return('spec/support')
7
- Rails.stub(:env).and_return('test')
8
5
  Hydra.stub(:config).and_return({
9
6
  :permissions=>{
10
7
  :catchall => "access_t",
@@ -2,11 +2,6 @@ require 'spec_helper'
2
2
  # Need way to find way to stub current_user and RoleMapper in order to run these tests
3
3
 
4
4
  describe Hydra::AccessControlsEnforcement do
5
- before do
6
- class Rails; end
7
- Rails.stub(:root).and_return('spec/support')
8
- Rails.stub(:env).and_return('test')
9
- end
10
5
  before(:all) do
11
6
  class MockController
12
7
  include Hydra::AccessControlsEnforcement
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe Hydra::PolicyAwareAbility do
4
4
  before do
5
- class Rails; end
6
- Rails.stub(:root).and_return('spec/support')
7
- Rails.stub(:env).and_return('test')
8
-
9
5
  Hydra.stub(:config).and_return({
10
6
  :permissions=>{
11
7
  :catchall => "access_t",
@@ -89,4 +85,4 @@ describe Hydra::PolicyAwareAbility do
89
85
  subject.read_persons_from_policy(@policy.pid).should == ["julius_caesar","nero"]
90
86
  end
91
87
  end
92
- end
88
+ end
@@ -1,11 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Hydra::PolicyAwareAccessControlsEnforcement do
4
- before do
5
- class Rails; end
6
- Rails.stub(:root).and_return('spec/support')
7
- Rails.stub(:env).and_return('test')
8
- end
9
4
  before(:all) do
10
5
  class MockController
11
6
  include Hydra::AccessControlsEnforcement
@@ -1,13 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe RoleMapper do
4
- before do
5
- class Rails; end
6
-
7
- Rails.stub(:root).and_return('spec/support')
8
- Rails.stub(:env).and_return('test')
9
- end
10
-
11
4
  it "should define the 4 roles" do
12
5
  RoleMapper.role_names.sort.should == %w(admin_policy_object_editor archivist donor patron researcher)
13
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-access-controls
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.pre1
4
+ version: 5.0.0.pre2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-09-26 00:00:00.000000000 Z
14
+ date: 2012-10-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport