def load_app_permissions(config: AppConfig) -> None:
    """
    Ensures that permissions and OPA rules from the given app are loaded.

    This function should be called from the AppConfig.ready() method of every
    app that defines a permissions module.
    """
    permissions_module = importlib.import_module(config.name + ".permissions")

    assert any(
        isinstance(attr, type) and issubclass(attr, OpenPolicyAgentPermission)
        for attr in vars(permissions_module).values()
    )

    add_opa_rules_path(Path(config.path, "rules"))

    Ensures that permissions and OPA rules from the given app are loaded.

    This function should be called from the AppConfig.ready() method of every
    app that defines a permissions module.
    
cvat/apps/iam/permissions.py