mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 02:59:17 +02:00
Ensure owner of tracks/albums/artists can approve suggestions
This commit is contained in:
parent
5b7fad0bef
commit
22bd1512c7
5 changed files with 86 additions and 7 deletions
|
@ -11,7 +11,12 @@ def can_suggest(obj, actor):
|
|||
|
||||
|
||||
def can_approve(obj, actor):
|
||||
return obj.is_local and actor.user and actor.user.get_permissions()["library"]
|
||||
if not obj.is_local or not actor.user:
|
||||
return False
|
||||
|
||||
return (
|
||||
actor.id is not None and actor.id == obj.attributed_to_id
|
||||
) or actor.user.get_permissions()["library"]
|
||||
|
||||
|
||||
class TagMutation(mutations.UpdateMutationSerializer):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue