title: I am trying to update profile and status if its their own profile and status. But the user is able to update others profile and status
body: <p>Thank you guys all in advance. Hoping for a soon response.</p>
  
  <p><strong>permission.py</strong></p>
  
  <pre><code>class UpdateRegister(permissions.BasePermission):
      """ Allow user to edit their own profile. """
  
      def has_object_permissions(self, request, view, obj):
          """ Check user is trying to edit their own profile. """
  
          if request.method in permissions.SAFE_METHODS:
              return True
  
          return obj.id == request.user.id
  
  
  class PostOwnStatus(permissions.BasePermission):
      """ Allow user to update their own status. """
  
      def has_object_permissions(self, request, view, obj):
          """ Check user is trying to update their own status. """
  
          if request.method in permissions.SAFE_METHODS:
              return True
  
          return obj.user_profile.id == request.user.id
  </code></pre>
  
  <p>This is the permission.py file where users are allow to edit or update their own profile and status.</p>
  
  <p>**view.py*</p>
  
  <pre><code>class UserViewSet(viewsets.ModelViewSet):
      """ API endpoint that allows users to be viewed or edited. """
  
      serializer_class = UserSerializer
      queryset = UserRegister.objects.all()
      authentication_classes = (TokenAuthentication,)
      permission_classes = (permissions.UpdateRegister,)
  
  class ProfileFeedViewSet(viewsets.ModelViewSet):
      """ Handles creating reading and updating profile feed. """
  
      serializer_class = ProfileFeedSerializer
      queryset = ProfileFeed.objects.all()
      authentication_classes = (TokenAuthentication,)
      permission_classes = (permissions.PostOwnStatus, IsAuthenticatedOrReadOnly)
  
      def perform_create(self, serializer):
          """Sets the user profile to the logged in user."""
  
          serializer.save(user_profile=self.request.user)
  </code></pre>
  
  <p>This is view.py file. Here i have got user view set and profile feed view set </p>
  
  <p><strong>serializer.py</strong></p>
  
  <pre><code>class UserSerializer(serializers.ModelSerializer):
      class Meta:
          model = UserRegister
          fields = ('id', 'name', 'email', 'password')
          extra_kwargs = {'password': {'write_only': True}}
  
      def create(self, validated_data):
          """ Create and return a new user"""
  
          user = UserRegister(
              email=validated_data['email'],
              name=validated_data['name'],
          )
          user.set_password(validated_data['password'])
          user.save()
  
          return user
  
  class ProfileFeedSerializer(serializers.ModelSerializer):
  """ Serialzer for profile feed. """
  
      class Meta:
       model = ProfileFeed
       fields = ('id', 'user_profile', 'post', 'created_on')
       extra_kwargs = {'user_profile': {'read_only':True}}
  </code></pre>