old_contents: from rest_framework import permissions
  
  
  class IsAuthenticatedOrRegistering(permissions.BasePermission):
      """
      Custom permission to allow access to authenticated users or those registering.
      """
      def has_permission(self, request, view):
          return request.user.is_authenticated() or request.method == 'POST'
new_contents: """
  Contains custom permissions for API app.
  """
  from rest_framework import permissions
  
  
  class IsAuthenticatedOrRegistering(permissions.BasePermission):
      """Allow access for authenticated users or those registering."""
  
      def has_permission(self, request, view):
          return request.user.is_authenticated() or request.method == 'POST'
  
subject: Reformat permissions.py for API app