'Get all page permission objects on which user/group is lover in
hierarchy then given user and given user can change permissions on them.
!IMPORTANT, but exclude objects with given user, or any group containing
this user - he can\'t be able to change his own permissions, because if
he does, and removes some permissions from himself, he will not be able
to add them anymore.
Example:
A
/                                      user    B,E
/                                   C,X     D,Y
Gives permission nodes C,X,D,Y under user, so he can edit
permissions if he haves can_change_permission.
Example:
A,Y
/                                      user    B,E,X
/                                   C,X     D,Y
Gives permission nodes C,D under user, so he can edit, but not
anymore to X,Y, because this users are on the same level or higher
in page hierarchy. (but only if user have can_change_permission)
Example:
A
/                                        user     B,E
/     \                                    C,X     D,Y    user
/                                               I      J,A
User permissions can be assigned to multiple page nodes, so merge of
all of them is required. In this case user can see permissions for
users C,X,D,Y,I,J but not A, because A user in higher in hierarchy.
If permission object holds group, this permission object can be visible
to user only if all of the group members are lover in hierarchy. If any
of members is higher then given user, this entry must stay invisible.
If user is superuser, or haves global can_change_permission permissions,
show him everything.
Result of this is used in admin for page permissions inline.'

def subordinate_to_user(self, user, site):

    from cms.utils.permissions import get_user_permission_level
    from cms.utils.page_permissions import get_change_permissions_id_list
    try:
        user_level = get_user_permission_level(user, site)
    except NoPermissionsException:
        return self.none()
    if (user_level == ROOT_USER_LEVEL):
        return self.all()
    page_id_allow_list = get_change_permissions_id_list(user, site, check_global=False)
    qs = self.filter(page__id__in=page_id_allow_list, page__depth__gte=user_level)
    qs = qs.exclude(user=user).exclude(group__user=user)
    return qs
