Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: records permissions dependency removal #53

Merged
merged 1 commit into from
Aug 8, 2016

Conversation

hachreak
Copy link
Member

@hachreak hachreak commented Aug 4, 2016

Signed-off-by: Leonardo Rossi leonardo.r@cern.ch

@@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just pushing the problem from inveniosoftware/invenio-records#137 down the stack? I.e. I don't think it should be added here.

For the example app, i think you can create an example of a permission factory that relies on metadata inside the record.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which permission factory do you propose as default for RECORDS_UI_DEFAULT_PERMISSION_FACTORY?

Copy link
Member

@lnielsen lnielsen Aug 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None ? 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means that I will remove also the tests that involve permissions?

Copy link
Member

@jirikuncar jirikuncar Aug 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deny_all by default? update: maybe too restrictive ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None looks fine because of this if

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lnielsen @jirikuncar
what would you like to do with the docs?
Could you help me to change it (if needed)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we can remove the reference to invenio_records and replace it with perm_factory defined in the paragraph above.

@hachreak
Copy link
Member Author

hachreak commented Aug 4, 2016

@jirikuncar @lnielsen
what about the PIDMissingObjectError? Should we handle in a more nice way than 500?

@lnielsen
Copy link
Member

lnielsen commented Aug 4, 2016

@hachreak In my opinion not, because it means something is wrong in the system. You have a record which is not deleted, not redirected etc, on which you have setup and endpoint, but it can't resolve down to a record.

@hachreak hachreak force-pushed the 138_permission branch 2 times, most recently from d480104 to fa7939b Compare August 4, 2016 16:05
@@ -268,7 +268,7 @@
permission factory:

>>> app.config['RECORDS_UI_DEFAULT_PERMISSION_FACTORY'] = \
... 'invenio_records.permissions:permission_factory'
... 'mymodule:my_permission_factory'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using perm_factory directly here instead a fictive path?

@@ -48,7 +47,8 @@ def permission_factory(self):
"""Load default permission factory."""
if self._permission_factory is None:
imp = self.app.config['RECORDS_UI_DEFAULT_PERMISSION_FACTORY']
self._permission_factory = import_string(imp) if imp else None
self._permission_factory = obj_or_import_string(imp) \
if imp else None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need it?

* Removes invenio-records permissions dependency.
  (addresses inveniosoftware/invenio-records#138)

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
@hachreak
Copy link
Member Author

hachreak commented Aug 8, 2016

ping @jirikuncar

@jirikuncar jirikuncar self-assigned this Aug 8, 2016
@jirikuncar jirikuncar merged commit 6a6f26c into inveniosoftware:master Aug 8, 2016
@hachreak hachreak deleted the 138_permission branch August 8, 2016 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants