Skip to content

Commit

Permalink
Merge pull request #81 from oarepo/krist/be-489-new-communities-on-co…
Browse files Browse the repository at this point in the history
…mmunities-not-working

user in community Need has a value field
  • Loading branch information
mesemus authored Oct 23, 2024
2 parents 9b794c5 + e5eb409 commit d6763df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions oarepo_communities/services/permissions/generators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import abc
import uuid
from collections import namedtuple
from functools import partial, reduce
from functools import reduce

from invenio_access.permissions import system_identity
from invenio_communities.communities.records.api import Community
Expand All @@ -19,8 +19,13 @@
)
from oarepo_communities.proxies import current_oarepo_communities

_Need = namedtuple("Need", ["method", "user", "community"])
UserInCommunityNeed = partial(_Need, "user_in_community")

def _user_in_community_need(user, community):
_Need = namedtuple("Need", ["method", "value", "user", "community"])
return _Need("user_in_community", f"{user}:{community}", user, community)


UserInCommunityNeed = _user_in_community_need


class InAnyCommunity(Generator):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-communities
version = 5.0.19
version = 5.0.20
description =
authors = Ronald Krist <[email protected]>
readme = README.md
Expand Down

0 comments on commit d6763df

Please sign in to comment.