mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-07-25 15:03:31 +00:00
option
This commit is contained in:
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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=[
|
||||||
|
Reference in New Issue
Block a user