{"record":{"id":"cec2b544c32e95e5","repo":"infiniflow/ragflow","slug":"not-implement-drop-role-role-name","errorCode":null,"errorMessage":"not implement: drop role: {role_name}","messagePattern":"not implement: drop role: (.+?)","errorType":"http","errorClass":"AdminException","httpStatus":400,"severity":"warning","filePath":"admin/server/roles.py","lineNumber":40,"sourceCode":"\nclass RoleMgr:\n    @staticmethod\n    def create_role(role_name: str, description: str):\n        error_msg = f\"not implement: create role: {role_name}, description: {description}\"\n        logging.error(error_msg)\n        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)","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/admin/server/roles.py#L22-L58","documentation":"RoleMgr.delete_role (admin/server/roles.py:40) is a stub: logs 'not implement: drop role: ...' and raises AdminException. No role is ever deleted because roles are not persisted anywhere in this version.","triggerScenarios":"Calling RoleMgr.delete_role(role_name) via the admin API/CLI role-deletion path.","commonSituations":"Cleanup attempts after experimenting with role endpoints; scripts assuming symmetry with create/list role APIs (which are equally stubbed).","solutions":["Skip role APIs entirely — nothing to delete since creation is also unimplemented.","Remove custom RBAC state in your own store if you extended RoleMgr in a fork."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from api.common.exceptions import AdminException\ntry:\n    RoleMgr.delete_role(name)\nexcept AdminException as e:\n    if str(e).startswith(\"not implement\"):\n        return  # nothing was created, nothing to delete\n    raise","preventionTips":["Treat the whole RoleMgr surface as unavailable; don't script create/delete pairs.","Watch upstream releases for the implemented RoleMgr."],"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"}