def post(self, entity_id):
        if not self.current_user:
            return self.json({
                'error': 'Forbidden!',
                'time': round(self.request.request_time(), 3),
            }, 403)

        if not entity_id:
            return self.json({
                'error': 'No entity ID!',
                'time': round(self.request.request_time(), 3),
            }, 400)

        right = self.get_argument('right', default=None, strip=True)
        if right and right not in ['viewer', 'expander', 'editor', 'owner']:
            return self.json({
                'error': 'Right type must be set!',
                'time': round(self.request.request_time(), 3),
            }, 400)

        related_entity_id = self.get_argument('entity', default=None, strip=True)
        if not related_entity_id:
            return self.json({
                'error': 'Entity ID must be set!',
                'time': round(self.request.request_time(), 3),
            }, 400)

        response = self.set_entity_right(entity_id=entity_id, related_entity_id=related_entity_id, right=right)

        self.json({
            'result': response,
            'time': round(self.request.request_time(), 3),
        })
dataset/ETHPy150Open argoroots/Entu/app/api/api2.py/API2EntityRights.post/original