python类ViewSet()的实例源码

fermentables.py 文件源码 项目:BrewCenterAPI 作者: BrewCenter 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def get_permissions(self):
        """Define custom permissions for different methods"""

        # at minimum require users to be authenticated
        self.permission_classes = [IsAuthenticated]
        # for PUT requests require users to be admins
        if self.request.method == 'PUT':
            self.permission_classes.append(IsAdminUser)

        return super(viewsets.ViewSet, self).get_permissions()
fermentables.py 文件源码 项目:BrewCenterAPI 作者: BrewCenter 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def get_permissions(self):
        """Define custom permissions for different methods"""

        # at minimum require users to be authenticated
        self.permission_classes = [IsAuthenticated]
        # for PUT requests require users to be admins
        if self.request.method == 'PUT':
            self.permission_classes.append(IsAdminUser)

        return super(viewsets.ViewSet, self).get_permissions()


问题


面经


文章

微信
公众号

扫码关注公众号