Feature/edit metadata authorization

I assume that pds_handle contain user group name(s) and thus we don't need to add roles. To reflect this I added customized method "groups" to user model. If the assumption is incorrect I will fix it and edit roles file.

this test passes for me, just ran it again

  @loggedin_FDA

  Scenario: Edit option not available to FDA cataloger for GIS records
            # features/edit_metadata_authorization.feature:14

    Given I am logged in as "*FDA Cataloger*"
              # features/step_definitions/login_steps.rb:8

    And I view record with id "
*sdr:DSS-NYCDCP_Mappluto_Test_11v1-DSS-jam_mappluto_7OR*" #
features/step_definitions/record_authorization_steps.rb:5

    Then the record should not have link "*Edit*"
              # features/step_definitions/record_authorization_steps.rb:9

I redefine permissions when GIS record is created from sdr.xml, so
edit_groups for that record is no longer 'public' it is gis_cataloger. Is
it possible that you use old cassette?

I have already re-wrote it again. Will try to push new code by Monday


Kate


On Fri, Jun 27, 2014 at 5:04 PM, barnabyalter <notifications@github.com>
wrote:

> In features/edit_metadata_authorization.feature:
>
> > +Feature: Permission to edit metadata only to authorized users
> > +  As a GIS cataloger,
> > +  I want to have permission to edit metadata
> > +  Only for GIS items
> > +
> > +  @loggedin_GIS
> > +    Scenario: Edit option available to GIS cataloger for GIS records
> > +    Given I am logged in as "GIS Cataloger"
> > +    And I view record with id "sdr:DSS-NYCDCP_Mappluto_Test_11v1-DSS-jam_mappluto_7OR"
> > +    Then the record should have link "Edit"
> > +
> > +  @loggedin_FDA
> > +    Scenario: Edit option not available to FDA cataloger for GIS records
> > +    Given I am logged in as "FDA Cataloger"
> > +    And I view record with id "sdr:DSS-NYCDCP_Mappluto_Test_11v1-DSS-jam_mappluto_7OR"
> > +    Then the record should not have link "Edit"
>
> @ekate <https://github.com/ekate> When I run this line Then the record
> should not have link "Edit" it always fails for me. I believe that
> because even though you are logged in as an FDA cataloger you've set the
> permissions for the records edit_groups to public so everyone should see
> the edit link.
>
> Am I understanding this correctly? Or are you getting this test passing
> for you?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/NYULibraries/ichabod/pull/30/files#r14315257>.
>



-- 
Ekaterina Pechekhonova
Digital Library Programmer/Analyst
New York University
Libraries
email: ekate@nyu.edu
phone: 212-992-9993