This commit is contained in:
Markos Gogoulos
2025-07-13 15:45:36 +03:00
parent 29d7731a9a
commit 53e7313cf7
3 changed files with 18 additions and 1 deletions

View File

@ -498,6 +498,9 @@ ALLOW_VIDEO_TRIMMER = True
ALLOW_CUSTOM_MEDIA_URLS = False ALLOW_CUSTOM_MEDIA_URLS = False
# Whether to allow anonymous users to list all users
ALLOW_ANONYMOUS_USER_LISTING = True
# ffmpeg options # ffmpeg options
FFMPEG_DEFAULT_PRESET = "medium" # see https://trac.ffmpeg.org/wiki/Encode/H.264 FFMPEG_DEFAULT_PRESET = "medium" # see https://trac.ffmpeg.org/wiki/Encode/H.264

View File

@ -500,6 +500,16 @@ By default `CAN_COMMENT = "all"` means that all registered users can add comment
- **advancedUser**, only users that are marked as advanced users can add comment. Admins or MediaCMS managers can make users advanced users by editing their profile and selecting advancedUser. - **advancedUser**, only users that are marked as advanced users can add comment. Admins or MediaCMS managers can make users advanced users by editing their profile and selecting advancedUser.
### 5.26 Control whether anonymous users can list all users
By default, anonymous users can view the list of all users on the platform. To restrict this to authenticated users only, set:
```
ALLOW_ANONYMOUS_USER_LISTING = False
```
When set to False, only logged-in users will be able to access the user listing API endpoint.
## 6. Manage pages ## 6. Manage pages
to be written to be written

View File

@ -188,8 +188,12 @@ Sender email: %s\n
class UserList(APIView): class UserList(APIView):
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
parser_classes = (JSONParser, MultiPartParser, FormParser, FileUploadParser) parser_classes = (JSONParser, MultiPartParser, FormParser, FileUploadParser)
def get_permissions(self):
if not settings.ALLOW_ANONYMOUS_USER_LISTING:
return [permissions.IsAuthenticated()]
return [permissions.IsAuthenticatedOrReadOnly()]
@swagger_auto_schema( @swagger_auto_schema(
manual_parameters=[ manual_parameters=[