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

ui: Require records community #2215

Closed
wants to merge 1 commit into from
Closed

Conversation

Samk13
Copy link
Member

@Samk13 Samk13 commented May 7, 2023

❤️ Thank you for your contribution!

Description

depends on: inveniosoftware/invenio-rdm-records#1283
closes: inveniosoftware/product-rdm#183

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Third-party code

If you've added third-party code (copy/pasted or new dependencies), please reach out to an architect.

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@Samk13 Samk13 force-pushed the master branch 2 times, most recently from a83c9ec to 51bce06 Compare May 8, 2023 22:41
@utnapischtim utnapischtim requested review from kpsherva and fenekku May 10, 2023 21:44
Copy link
Contributor

@fenekku fenekku left a comment

Choose a reason for hiding this comment

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

I think the conceptual clarification on the whole feature is more important than the code-side for this. See inveniosoftware/invenio-rdm-records#1283 (review) .

Again, I was just asked to review as an outsider, so I am not familiar/my take probably doesn't count for much. I'll let others chime in.

Comment on lines 365 to 366
# Can't check "publish" permission as draft is not a record with an id yet.
permissions["can_publish_restricted"] = current_app.config.get(
Copy link
Contributor

Choose a reason for hiding this comment

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

What does "can published restricted" mean? It reads as: current user can publish a restricted record. How does it relate to requiring a community? (same question as other pr).

Copy link
Member Author

@Samk13 Samk13 May 12, 2023

Choose a reason for hiding this comment

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

I appreciate your feedback regarding the potential confusion that this naming may cause, especially in relation to restricted records. To help resolve this, I'm open to suggestions for a more suitable name. Here are three alternative names that might be clearer:
can_publish_needs_community_config
can_not_publish_without_community_config
can_not_publish_config
Please share your thoughts or other naming suggestions you might have so we change it all at once @fenekku.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see hmm ...

can_publish_with_community_only
can_publish_w_community_only

but...

My take would be to move this feature outside of permissions altogether (but maybe that was recommended by an architect) and place it at the record validation level given all that 😅 . It's non-trivial to do, so it's not great advice on its own 🤔 ... I understand why permissions changes were easier at first... Let's see what CERN recommends 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your input!
I will go with can_publish_with_community_only.
I see your point about moving this feature out of permissions and into record validation. However, the current approach is indeed similar to this one #2207, where the configuration is passed in a similar way.

Let's see what the CERN team recommends - whether they suggest a separate channel for passing this configuration or if it remains as a part of permissions or a completely different approach. In the meantime, if you can direct me to some resources or examples where this has been implemented at the record validation level, I'd look into it and explore the possibilities.

Copy link
Contributor

@fenekku fenekku May 15, 2023

Choose a reason for hiding this comment

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

I was looking for such an example this morning, without finding super clear ones. I think this schema: https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/services/config.py#L135 defined here https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/services/schemas/record_communities.py#L23 is maybe the kind of location where we would want to have that check reside (I don't think it's necessarily this exact space) i.e., schemas might be the place...

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for sharing the links, but still, they do not sufficiently clarify how I can attain the same outcomes in the services and UI without modifying the permissions. We must ensure there's absolutely no possibility for a user to publish both from the UI and API levels. Could you provide a more detailed example illustrating your approach to rectifying both the UI and service aspects?

Copy link
Contributor

This PR was automatically marked as stale.

@github-actions github-actions bot added the stale No activity for more than 60 days. label Feb 14, 2024
@kpsherva kpsherva self-assigned this Mar 19, 2024
@Samk13 Samk13 force-pushed the master branch 2 times, most recently from a2d4360 to c6462a7 Compare March 20, 2024 15:59
@ntarocco ntarocco assigned ntarocco and unassigned kpsherva Mar 21, 2024
@Samk13
Copy link
Member Author

Samk13 commented Apr 8, 2024

Closing this PR as the changes were mistakenly made on the master branch. I've created a new branch with these changes and opened a new PR here: 2642. Thanks for your understanding.

@Samk13 Samk13 closed this Apr 8, 2024
@Samk13 Samk13 mentioned this pull request Apr 8, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No activity for more than 60 days.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Require a community when uploading
4 participants