mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 01:29:16 +02:00
Removed obsolete permissions, added a new moderation permission
This commit is contained in:
parent
af53ee7c7d
commit
34ec869ca1
9 changed files with 60 additions and 70 deletions
|
@ -34,16 +34,15 @@ def get_token():
|
|||
|
||||
|
||||
PERMISSIONS_CONFIGURATION = {
|
||||
"federation": {
|
||||
"label": "Manage library federation",
|
||||
"help_text": "Follow other instances, accept/deny library follow requests...",
|
||||
"moderation": {
|
||||
"label": "Moderation",
|
||||
"help_text": "Block/mute/remove domains, users and content",
|
||||
},
|
||||
"library": {
|
||||
"label": "Manage library",
|
||||
"help_text": "Manage library, delete files, tracks, artists, albums...",
|
||||
},
|
||||
"settings": {"label": "Manage instance-level settings", "help_text": ""},
|
||||
"upload": {"label": "Upload new content to the library", "help_text": ""},
|
||||
}
|
||||
|
||||
PERMISSIONS = sorted(PERMISSIONS_CONFIGURATION.keys())
|
||||
|
@ -71,9 +70,9 @@ class User(AbstractUser):
|
|||
subsonic_api_token = models.CharField(blank=True, null=True, max_length=255)
|
||||
|
||||
# permissions
|
||||
permission_federation = models.BooleanField(
|
||||
PERMISSIONS_CONFIGURATION["federation"]["label"],
|
||||
help_text=PERMISSIONS_CONFIGURATION["federation"]["help_text"],
|
||||
permission_moderation = models.BooleanField(
|
||||
PERMISSIONS_CONFIGURATION["moderation"]["label"],
|
||||
help_text=PERMISSIONS_CONFIGURATION["moderation"]["help_text"],
|
||||
default=False,
|
||||
)
|
||||
permission_library = models.BooleanField(
|
||||
|
@ -86,11 +85,6 @@ class User(AbstractUser):
|
|||
help_text=PERMISSIONS_CONFIGURATION["settings"]["help_text"],
|
||||
default=False,
|
||||
)
|
||||
permission_upload = models.BooleanField(
|
||||
PERMISSIONS_CONFIGURATION["upload"]["label"],
|
||||
help_text=PERMISSIONS_CONFIGURATION["upload"]["help_text"],
|
||||
default=False,
|
||||
)
|
||||
|
||||
last_activity = models.DateTimeField(default=None, null=True, blank=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue