Пример #1
0
class UserViewSet(viewsets.ModelViewSet):
    """
    ModelViewSet for getting all Users

    Access Control
    ===============
    - AppsMallSteward can view

    URIs
    ======
    GET /api/user/
    Summary:
        Get a list of all system-wide Users
    Response:
        200 - Successful operation - [UserSerializer]

    POST /api/user/
    Summary:
        Add a User
    Request:
        data: UserSerializer Schema
    Response:
        200 - Successful operation - UserSerializer

    GET /api/user/{pk}
    Summary:
        Find a User by ID
    Response:
        200 - Successful operation - UserSerializer

    PUT /api/user/{pk}
    Summary:
        Update a User by ID

    PATCH /api/user/{pk}
    Summary:
        Update (Partial) a User by ID

    DELETE /api/user/{pk}
    Summary:
        Delete a User by ID
    """

    permission_classes = (permissions.IsOrgSteward,)
    queryset = model_access.get_all_users()
    serializer_class = serializers.UserSerializer
Пример #2
0
class UserViewSet(viewsets.ModelViewSet):
    permission_classes = (permissions.IsOrgSteward,)
    queryset = model_access.get_all_users()
    serializer_class = serializers.UserSerializer