def _parse_permission(self, obj):
        """
        从 obj 中取出权限
        :param obj:
        :return: [A.QUERY, A.WRITE, ...]
        """
        if isinstance(obj, str):
            if obj == '*':
                return A.ALL
            elif obj in A.ALL:
                return obj,
            else:
                logger.warning('Invalid permission action: %s', obj)
        elif isinstance(obj, (list, tuple)):
            for i in obj:
                if i not in A.ALL:
                    logger.warning('Invalid permission action: %s', i)
            return obj
        elif isinstance(obj, dict):
            return self._parse_permission(obj.get('*'))
def _parse_permission(self, obj):
        """
        从 obj 中取出权限
        :param obj:
        :return: [A.QUERY, A.WRITE, ...]
        """
        if isinstance(obj, str):
            if obj == '*':
                return A.ALL
            elif obj in A.ALL:
                return obj,
            else:
                logger.warning('Invalid permission action: %s', obj)
        elif isinstance(obj, (list, tuple)):
            for i in obj:
                if i not in A.ALL:
                    logger.warning('Invalid permission action: %s', i)
            return obj
        elif isinstance(obj, dict):
            return self._parse_permission(obj.get('*'))
def _parse_permission ( self , obj ) : if isinstance ( obj , str ) : if obj == '*' : return A . ALL elif obj in A . ALL : return obj , else : logger . warning ( 'Invalid permission action: %s' , obj ) elif isinstance ( obj , ( list , tuple ) ) : for i in obj : if i not in A . ALL : logger . warning ( 'Invalid permission action: %s' , i ) return obj elif isinstance ( obj , dict ) : return self . _parse_permission ( obj . get ( '*' ) )
从 obj 中取出权限
        :param obj:
        :return: [A.QUERY, A.WRITE, ...]
从 obj 中取出权限 : param obj : : return : [ A . QUERY A . WRITE ... ]