infiniflow/ragflow · warning · AdminException

not implement: update user role: {user_name} to role {role_n

Error message

not implement: update user role: {user_name} to role {role_name}

What it means

RoleMgr.update_user_role (admin/server/roles.py:70) is a stub: logs 'not implement: update user role: {user_name} to role {role_name}' and raises AdminException. Assigning roles to users is unimplemented, so user-to-role mapping requests always fail without side effects.

Source

Thrown at admin/server/roles.py:70

        raise AdminException(error_msg)

    @staticmethod
    def grant_role_permission(role_name: str, actions: list, resource: str) -> Dict[str, Any]:
        error_msg = f"not implement: grant role {role_name} actions: {actions} on {resource}"
        logging.error(error_msg)
        raise AdminException(error_msg)

    @staticmethod
    def revoke_role_permission(role_name: str, actions: list, resource: str) -> Dict[str, Any]:
        error_msg = f"not implement: revoke role {role_name} actions: {actions} on {resource}"
        logging.error(error_msg)
        raise AdminException(error_msg)

    @staticmethod
    def update_user_role(user_name: str, role_name: str) -> Dict[str, Any]:
        error_msg = f"not implement: update user role: {user_name} to role {role_name}"
        logging.error(error_msg)
        raise AdminException(error_msg)

    @staticmethod
    def get_user_permission(user_name: str) -> Dict[str, Any]:
        error_msg = f"not implement: get user permission: {user_name}"
        logging.error(error_msg)
        raise AdminException(error_msg)

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Use the implemented mechanisms: change tenant role (UserTenantRole via tenant APIs) or is_superuser in the DB.
  2. Implement the method in a fork backed by your own role-mapping table.
Defensive patterns

Strategy: try-catch

Try / catch

from api.common.exceptions import AdminException
try:
    RoleMgr.update_user_role(user, role)
except AdminException as e:
    if str(e).startswith("not implement"):
        # assign tenant role / is_superuser via implemented user/tenant APIs instead
        raise NotImplementedError("user-role assignment unsupported") from e
    raise

Prevention

When it happens

Trigger: Calling RoleMgr.update_user_role(user_name, role_name) via an admin user-management endpoint that delegates to it.

Common situations: Onboarding flows trying to put users into roles; admins assuming RAGFlow has role-based user assignment like conventional portals.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/fa5e9018c422aa3d. Report an issue: GitHub.