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

permissions: improve generation records permissions #1956

Merged
merged 1 commit into from
May 31, 2021

Conversation

lauren-d
Copy link
Contributor

@lauren-d lauren-d commented May 28, 2021

When we calculate permissions for records, we have double call on get_links_to_me().
To fix that, IlsRecord.can_delete return a tuple with True|False and reasons not to delete
if False.

Co-Authored-by: Laurent Dubois [email protected]

Why are you opening this PR?

  • Which task/US does it implement?
  • Which issue does it fix?

Dependencies

My PR depends on the following rero-ils-ui"s PR(s):

  • rero/rero-ils-ui#

How to test?

  • What command should I have to run to test your PR?
  • What should I test through the UI?

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?
  • Cypress tests successful?

@lauren-d lauren-d self-assigned this May 28, 2021
@lauren-d lauren-d force-pushed the lau-improve-permissions-performance branch from f3b9699 to 5c7414e Compare May 28, 2021 07:54
rero_ils/modules/api.py Outdated Show resolved Hide resolved
@lauren-d lauren-d force-pushed the lau-improve-permissions-performance branch from 5c7414e to 58b5c95 Compare May 28, 2021 08:10
@lauren-d lauren-d force-pushed the lau-improve-permissions-performance branch 4 times, most recently from 02425c9 to 63b7e2c Compare May 28, 2021 11:38
@lauren-d lauren-d changed the title global: increase performance to generate records permissions. global: improve generation of records permissions May 28, 2021
@lauren-d lauren-d added performance f: permissions Concerns the rights management labels May 28, 2021
@lauren-d lauren-d force-pushed the lau-improve-permissions-performance branch from 63b7e2c to ca23a81 Compare May 28, 2021 12:19
Copy link

@iGormilhit iGormilhit left a comment

Choose a reason for hiding this comment

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

Commit message reformatting, and slightly changed:

permissions: improve generation records permissions

When we calculate permissions for records, we have double call on
get_links_to_me().  To fix that, IlsRecord.can_delete return a tuple
with True|False and reasons not to delete if False.

When we calculate permissions for records, we have double call on
get_links_to_me().  To fix that, IlsRecord.can_delete return a tuple
with True|False and reasons not to delete if False.

Co-Authored-by: Laurent Dubois <[email protected]>
@lauren-d lauren-d force-pushed the lau-improve-permissions-performance branch from ca23a81 to 0eae1c8 Compare May 31, 2021 06:09
@lauren-d
Copy link
Contributor Author

Commit message reformatting, and slightly changed:

permissions: improve generation records permissions

When we calculate permissions for records, we have double call on
get_links_to_me().  To fix that, IlsRecord.can_delete return a tuple
with True|False and reasons not to delete if False.

ok, thanks

@iGormilhit iGormilhit changed the title global: improve generation of records permissions permissions: improve generation records permissions May 31, 2021
@lauren-d lauren-d merged commit 1d4a8de into rero:dev May 31, 2021
@lauren-d lauren-d deleted the lau-improve-permissions-performance branch June 15, 2021 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: permissions Concerns the rights management performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants