vecnet / dl-discovery

Map based discovery interface for digital library records
Other
4 stars 3 forks source link

Add access control enforcement #37

Closed dbrower closed 9 years ago

dbrower commented 9 years ago

The access control fields are being put into solr. Need to do the following:

stevenvandervalk commented 9 years ago

Options 1) Can copy code not gem from Hydra guys OR 2) checkout Earthworks filter

dbrower commented 9 years ago

Look at this gem: https://github.com/projecthydra/hydra-head/tree/master/hydra-access-controls

The access info is stored in the following solr fields: read_access_group_sm, read_access_person_sm, edit_access_group_sm, edit_access_person_sm.

stevenvandervalk commented 9 years ago

@dbrower So I went and merged authz into qa-deploy and a local deploy errors on a item show page with

TypeError (no implicit conversion of String into Integer):
  app/constraints/show_access_controls.rb:18:in `[]'
  app/constraints/show_access_controls.rb:18:in `enforce_show_permissions'
stevenvandervalk commented 9 years ago

I was trying to debug this but rails c on vagrant gives me

'development' database is not configured. Available: ["jcu"]

Can I add that in ansible here ?

https://github.com/vecnet/deploy-dl/blob/b03fadad80212cbe060ea927e725b9ac468635fc/roles/vecnet/templates/database.yml.j2#L1

dbrower commented 9 years ago

I will fix the TypeError.

I don't understand what you are asking about the ansible. it looks like the vagrant deploy should have a rails environment of development, but actually has a rails envirionment of jcu?

stevenvandervalk commented 9 years ago

I think so. What happens when you vagrant ssh sa source chruby etc and call rails console?

dbrower commented 9 years ago

Good question. I will try this first thing next week, maybe.

On Thursday, June 11, 2015, Steve Vandervalk notifications@github.com wrote:

I think so. What happens when you vagrant ssh sa source chruby etc and call rails console?

— Reply to this email directly or view it on GitHub https://github.com/vecnet/dl-discovery/issues/37#issuecomment-111280722.

Donald Brower, Ph.D.* Digital Infrastructure Lead*

University of Notre Dame 208 Hesburgh Library Notre Dame, IN 46556 o: 574-631-1566 e: dbrower@nd.edu

dbrower commented 9 years ago

This issue was addressed with 13c785ce16a4d654110a85b36c0634053c51b601.

Working on vagrant question now.

dbrower commented 9 years ago

The error you saw in vagrant is because the rails environment was not set when you ran rails console, so rails defaulted it to development. Run this instead:

RAILS_ENV=jcu bundle exec rails c
stevenvandervalk commented 9 years ago

Hmm I wonder if I messed with my local.yml settings somehow as that didn't work for me before. But now did rm and re cloned a clean master of deploy-dl and presto. Thanks!