openslides_backend/presenter/get_user_related_models.py
def check_permissions(self, result: Any) -> None:
        """It first collects the meetings which are included and checks them."""
        if has_organization_management_level(
            self.datastore, self.user_id, OrganizationManagementLevel.CAN_MANAGE_USERS
        ):
            return
        for user_id in result:
            meeting_ids = []
            for meeting in result[user_id].get("meetings", []):
                meeting_ids.append(meeting["id"])
            if not all(
                has_perm(
                    self.datastore,
                    self.user_id,
                    Permissions.User.CAN_MANAGE,
                    meeting_id,
                )
                for meeting_id in meeting_ids
            ):
                raise MissingPermission(OrganizationManagementLevel.CAN_MANAGE_USERS)
            committee_ids = []
            for committee in result[user_id].get("committees", []):
                committee_ids.append(committee["id"])
            if not all(
                has_committee_management_level(
                    self.datastore,
                    self.user_id,
                    CommitteeManagementLevel.CAN_MANAGE,
                    committee_id,
                )
                for committee_id in committee_ids
            ):
                raise MissingPermission(OrganizationManagementLevel.CAN_MANAGE_USERS)
It first collects the meetings which are included and checks them.
It first collects the meetings which are included and checks them.
It first collects the meetings which are included and checks them .
def check_permissions(self, result: Any) -> None:
        if has_organization_management_level(
            self.datastore, self.user_id, OrganizationManagementLevel.CAN_MANAGE_USERS
        ):
            return
        for user_id in result:
            meeting_ids = []
            for meeting in result[user_id].get("meetings", []):
                meeting_ids.append(meeting["id"])
            if not all(
                has_perm(
                    self.datastore,
                    self.user_id,
                    Permissions.User.CAN_MANAGE,
                    meeting_id,
                )
                for meeting_id in meeting_ids
            ):
                raise MissingPermission(OrganizationManagementLevel.CAN_MANAGE_USERS)
            committee_ids = []
            for committee in result[user_id].get("committees", []):
                committee_ids.append(committee["id"])
            if not all(
                has_committee_management_level(
                    self.datastore,
                    self.user_id,
                    CommitteeManagementLevel.CAN_MANAGE,
                    committee_id,
                )
                for committee_id in committee_ids
            ):
                raise MissingPermission(OrganizationManagementLevel.CAN_MANAGE_USERS)
def check_permissions ( self , result : Any ) -> None : if has_organization_management_level ( self . datastore , self . user_id , OrganizationManagementLevel . CAN_MANAGE_USERS ) : return for user_id in result : meeting_ids = [ ] for meeting in result [ user_id ] . get ( "meetings" , [ ] ) : meeting_ids . append ( meeting [ "id" ] ) if not all ( has_perm ( self . datastore , self . user_id , Permissions . User . CAN_MANAGE , meeting_id , ) for meeting_id in meeting_ids ) : raise MissingPermission ( OrganizationManagementLevel . CAN_MANAGE_USERS ) committee_ids = [ ] for committee in result [ user_id ] . get ( "committees" , [ ] ) : committee_ids . append ( committee [ "id" ] ) if not all ( has_committee_management_level ( self . datastore , self . user_id , CommitteeManagementLevel . CAN_MANAGE , committee_id , ) for committee_id in committee_ids ) : raise MissingPermission ( OrganizationManagementLevel . CAN_MANAGE_USERS )
It first collects the meetings which are included and checks them.
It first collects the meetings which are included and checks them .
"""It first collects the meetings which are included and checks them."""
self
result
Any