A decorator that sets a list of permissions for a function.

        :param perms: The list of permission instances or classes.
        :return: A function

def permissions(self, perms):
        """
        A decorator that sets a list of permissions for a function.

        :param perms: The list of permission instances or classes.
        :return: A function
        """

        if not isinstance(perms, (list, tuple)):
            perms = [perms]

        instances = []

        for perm in perms:
            if isclass(perm):
                instances.append(perm())
            else:
                instances.append(perm)

        def decorator(func):
            func.permissions = instances
            return func
        return decorator