Skip to content

Commit

Permalink
Fix beta search features permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Apr 18, 2024
1 parent ff08302 commit 1433eef
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Currently, we only use the following custom permissions:
* `tickets.can_moderate` (in `Ticket` model, used to allow sound moderation)
* `forum.can_moderate_forum` (in `Post` model, used to allow forum moderation)
* `sounds.can_describe_in_bulk` (in `BulkUploadProgress` model, used to allow bulk upload for users who don't meet the other common requirements)
* `profile.show_beta_search_options` (in `Profile` model, used to allow using beta search features)
* `profile.can_beta_test` (in `Profile` model, used to allow using beta search features)


### URLs that include a username
Expand Down
14 changes: 14 additions & 0 deletions accounts/fixtures/user_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,19 @@
]
]
}
},
{
"model": "auth.group",
"pk": 10,
"fields": {
"name": "beta_testers",
"permissions": [
[
"can_beta_test",
"accounts",
"profile"
]
]
}
}
]
2 changes: 1 addition & 1 deletion utils/search/search_sounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,5 @@ def get_sound_ids_from_search_engine_query(query_params, current_page=None, num_
def allow_beta_search_features(request):
if not request.user.is_authenticated:
return False
if request.user.has_perm('profile.show_beta_search_options'):
if request.user.has_perm('profile.can_beta_test'):
return True

0 comments on commit 1433eef

Please sign in to comment.