{"record":{"id":"ea01c76f583422e1","repo":"infiniflow/ragflow","slug":"not-implement-list-roles","errorCode":null,"errorMessage":"not implement: list roles","messagePattern":"not implement: list roles","errorType":"http","errorClass":"AdminException","httpStatus":400,"severity":"warning","filePath":"admin/server/roles.py","lineNumber":46,"sourceCode":"        raise AdminException(error_msg)\n\n    @staticmethod\n    def update_role_description(role_name: str, description: str) -> Dict[str, Any]:\n        error_msg = f\"not implement: update role: {role_name} with description: {description}\"\n        logging.error(error_msg)\n        raise AdminException(error_msg)\n\n    @staticmethod\n    def delete_role(role_name: str) -> Dict[str, Any]:\n        error_msg = f\"not implement: drop role: {role_name}\"\n        logging.error(error_msg)\n        raise AdminException(error_msg)\n\n    @staticmethod\n    def list_roles() -> Dict[str, Any]:\n        error_msg = \"not implement: list roles\"\n        logging.error(error_msg)\n        raise AdminException(error_msg)\n\n    @staticmethod\n    def get_role_permission(role_name: str) -> Dict[str, Any]:\n        error_msg = f\"not implement: show role {role_name}\"\n        logging.error(error_msg)\n        raise AdminException(error_msg)\n\n    @staticmethod\n    def grant_role_permission(role_name: str, actions: list, resource: str) -> Dict[str, Any]:\n        error_msg = f\"not implement: grant role {role_name} actions: {actions} on {resource}\"\n        logging.error(error_msg)\n        raise AdminException(error_msg)\n\n    @staticmethod\n    def revoke_role_permission(role_name: str, actions: list, resource: str) -> Dict[str, Any]:\n        error_msg = f\"not implement: revoke role {role_name} actions: {actions} on {resource}\"\n        logging.error(error_msg)\n        raise AdminException(error_msg)","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/admin/server/roles.py#L28-L64","documentation":"RoleMgr.list_roles (admin/server/roles.py:46) is a stub that logs 'not implement: list roles' and raises AdminException. It cannot return the declared Dict[str, Any]; any role listing request fails instead of returning an (empty) role set.","triggerScenarios":"Calling RoleMgr.list_roles() — e.g. an admin console 'roles' page or CLI list command delegating to it.","commonSituations":"UI panels or SDKs enumerating roles during discovery/setup and hitting the unconditional raise.","solutions":["Do not query role listings in this version; the feature is not implemented.","If you must render a roles page, catch AdminException here and show an 'unsupported' state rather than an error.","Implement list_roles in a fork backed by your permission store."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from api.common.exceptions import AdminException\ntry:\n    roles = RoleMgr.list_roles()\nexcept AdminException as e:\n    if str(e).startswith(\"not implement\"):\n        roles = {}  # render 'roles unsupported' in UI instead of erroring\n    else:\n        raise","preventionTips":["Have admin UIs degrade to 'unsupported' when a listing API raises not-implement.","Don't use role listing as a health check for the admin server."],"tags":["not-implemented","roles","rbac","admin"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}