Skip to content

feat: adds collection CRUD ui#1347

Merged
zzacharo merged 8 commits into
inveniosoftware:masterfrom
jrcastro2:add-collections-crud
Apr 2, 2026
Merged

feat: adds collection CRUD ui#1347
zzacharo merged 8 commits into
inveniosoftware:masterfrom
jrcastro2:add-collections-crud

Conversation

@jrcastro2
Copy link
Copy Markdown
Contributor

@jrcastro2 jrcastro2 commented Jan 15, 2026

@jrcastro2 jrcastro2 force-pushed the add-collections-crud branch 2 times, most recently from 521b121 to 2bede92 Compare January 20, 2026 11:05
Copy link
Copy Markdown
Contributor

@kpsherva kpsherva left a comment

Choose a reason for hiding this comment

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

I am wondering, and it would be nice to hear from the others too. Shouldn't the UI implementation be in invenio communities as well?

@jrcastro2 jrcastro2 force-pushed the add-collections-crud branch from 2bede92 to 0983348 Compare January 21, 2026 09:29
@egabancho
Copy link
Copy Markdown
Member

I remember talking with @slint about this some time ago, and they (Zenodo) would like the ability to hide the collection management from the interface because they don't want any community owner to be able add collections to Zenodo.
We discussed ways to implement that, and permissions seemed to be a good candidate back then.

It might be worth checking if this is still the case.

@jrcastro2 jrcastro2 force-pushed the add-collections-crud branch from a59ca20 to f4839d6 Compare January 28, 2026 14:40
@ntarocco
Copy link
Copy Markdown
Contributor

ntarocco commented Jan 28, 2026

don't want any community owner to be able add collections to Zenodo.

I doubt that it is entirely true.
They want to limit it for some communities, but for most of them, it should be allowed.

Can't we have a "manage collections" permission, that will hide/show/control the mgnt part of the community's collection? An instance can override the default, and implement its own.

@jrcastro2 jrcastro2 force-pushed the add-collections-crud branch from 74da0fe to bfcd1ac Compare February 4, 2026 13:14
Comment thread setup.cfg Outdated
invenio-administration>=5.0.0,<6.0.0
invenio-vocabularies>=9.0.0,<10.0.0
invenio-administration>=4.0.0,<5.0.0
invenio-collections>=3.0.0,<4.0.0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is still being discussed.

Comment thread invenio_communities/ext.py Outdated
or current_app.config["COMMUNITIES_DEFAULT_RECORD_SUBMISSION_POLICY"]
)
self.review_policy = review_policy or ReviewPolicyEnum.CLOSED
self.collections_enabled = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we need to know in the community access if the collections are enabled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, good point, is not anymore needed, was meant to enable the collections management per community, but I guess we can simply rely on the permission levels and let the owners (or whoever is granted access) to manage itself. Will remove this.

Comment thread invenio_communities/communities/resources/ui_schema.py
Comment thread invenio_communities/permissions.py Outdated
can_read = [AnyUser(), SystemProcess()]


can_manage_collections = [CommunityOwners(), SystemProcess()]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to be discussed: only owners, not maangers?

Copy link
Copy Markdown
Contributor

@kpsherva kpsherva Mar 26, 2026

Choose a reason for hiding this comment

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

I think this complicates things slightly and I am not sure if I understand what is the use case for having granular rights on the collection of the community.
my understanding is:

  • if someone can_read the community and it's records, they should be able to also see the collections created on the community. Why would we hide from anyone a list of available search queries or how we group content?
  • can_manage_collections, I would rather place it in the CommunityPermissionPolicy, because if there is no community, there is no collections to manage. If we are aiming to restrict the collections management to some role then the policy should go to the invenio-collections module and should not be dependent on the community at all. ping @slint for input.
    In addition I think community managers should also be able to manage collections.

if you remove this policy class, you can also remove the config variable and additional reading prefix in ext.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some quick thoughts:

  • agree on having managers also be able to manage collections (it's in the name anyways :) )
  • regarding placement, given that at some point there will be support for global collections (or other types, as folks requested) having a dedicated section for "permissions for community collections", would probably make sense... Having this on the community permission class would be most "fitting" now, similar to how we have can_manage_files, etc. on record permsisions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to summarise:

  • we should have can_manage_collections in CommunityPermissions (can_read is not needed) which includes also CanManage() generator
  • remove CollectionsPermissionPolicy completely
  • remove the reading of prefix "COLLECTIONS" in the ext.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could do all that but we wouls still need to set COLLECTIONS_PERMISSION_POLICY to - in this case - CommunityPermissions. If we want to remove the reading of the prefix "COLLECTIONS" that would mean that we need to wire this up in invenio-app-rdm, the downside is that anyone using invenio-communities with collections outside rdm would need to configure that as well. Please confirm this change and I will go ahead, thanks!

Comment thread invenio_communities/generators.py Outdated
@jrcastro2 jrcastro2 force-pushed the add-collections-crud branch 2 times, most recently from 254c5ee to 2c6f771 Compare March 25, 2026 14:33
Comment thread invenio_communities/views/communities.py Outdated
Comment thread invenio_communities/views/ui.py Outdated
Comment thread invenio_communities/views/communities.py Outdated
Comment thread invenio_communities/webpack.py Outdated
Comment thread invenio_communities/webpack.py Outdated
@jrcastro2 jrcastro2 force-pushed the add-collections-crud branch from 2c6f771 to a07bdc4 Compare March 30, 2026 18:34
@jrcastro2 jrcastro2 force-pushed the add-collections-crud branch from 4603691 to 6e0a0a5 Compare April 2, 2026 14:30
@zzacharo zzacharo merged commit f9ce365 into inveniosoftware:master Apr 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 - Implement full collections management + Browse tab visibility rules

8 participants