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.

I changed nyucore model by including

Hydra::AccessControls::Permissions.

It means that now any new nyucore object will not be editable by anyone
before that field is defined. I wasn't sure how to define this field in
general case and give the most broad permissions until it is decided
otherwise. That's why the group 'public' on creation. In case of gis record
that is immediately over-written by group gis_cataloger. I can do the
similar changes for FDA records (add fda_cataloger group). If we don't
wan't to have group 'public' here we need to re-write some tests. We could
either write separate tests for object with different provenance or create
a special test group.
I also have more general question:  why do we need to change ability.rb as
in Esha's user story ? I was under impression that, If the edit_groups
field is defined on object level it would work with native ability.rb
methods. At least it worked that way in my user story.

Kate



On Wed, Jun 18, 2014 at 12:34 PM, barnabyalter <notifications@github.com>
wrote:

> In app/controllers/nyucores_controller.rb:
>
> > @@ -29,6 +29,7 @@ def edit
> >
> >    def create
> >      @item = Nyucore.new(item_params)
> > +    @item.set_edit_groups(['public'],[])
>
> @ekate <https://github.com/ekate> Could you put a comment as to what is
> going on here?
>
> I think that setting the edit group to 'public' on newly created items
> means that any users, regardless of being logged in or not, can edit this
> item, per
> https://github.com/projecthydra/hydra-head/wiki/Lesson:-Quick-Overview-of-Access-Controls-in-Hydra#two-special-types-of-groups-registered-and-public
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/NYULibraries/ichabod/pull/30/files#r13925115>.
>



-- 
Ekaterina Pechekhonova
Digital Library Programmer/Analyst
New York University
Libraries
email: ekate@nyu.edu
phone: 212-992-9993