{"record":{"id":"6de1ade23ddbfa36","repo":"infiniflow/ragflow","slug":"not-implement-create-role-role-name-descripti","errorCode":null,"errorMessage":"not implement: create role: {role_name}, description: {description}","messagePattern":"not implement: create role: (.+?), description: (.+?)","errorType":"http","errorClass":"AdminException","httpStatus":400,"severity":"warning","filePath":"admin/server/roles.py","lineNumber":28,"sourceCode":"#  Unless required by applicable law or agreed to in writing, software\n#  distributed under the License is distributed on an \"AS IS\" BASIS,\n#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#  See the License for the specific language governing permissions and\n#  limitations under the License.\n#\nimport logging\n\nfrom typing import Dict, Any\n\nfrom api.common.exceptions import AdminException\n\n\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)","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/admin/server/roles.py#L10-L46","documentation":"RoleMgr.create_role (admin/server/roles.py:28) is an unimplemented stub: it logs 'not implement: create role: ...' and immediately raises AdminException. The entire RoleMgr role-management API surface is placeholder code — calling create_role never performs work, it only reports that the feature is not yet built. There is no default AdminException status, so it surfaces as a generic 500-style admin error.","triggerScenarios":"Invoking RoleMgr.create_role(role_name, description) directly, or hitting whichever admin route/CLI command delegates to it (role creation in the admin console).","commonSituations":"Users exploring the admin API for RBAC and assuming roles are supported; automated scripts generated from API docs that list role endpoints.","solutions":["Do not call this API — role creation is not implemented in this RAGFlow version.","Manage authorization where it is implemented: is_superuser flags on users and tenant roles (UserTenantRole) in the DB.","Track/patch the upstream implementation if you need RBAC, or implement RoleMgr.create_role against your own permission store."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# there is no supported role store to validate against; treat create_role as unavailable\nfrom admin.server.roles import RoleMgr\nROLE_APIS_IMPLEMENTED = False  # guard your tooling on this flag","typeGuard":null,"tryCatchPattern":"from api.common.exceptions import AdminException\ntry:\n    RoleMgr.create_role(name, desc)\nexcept AdminException as e:\n    if str(e).startswith(\"not implement\"):\n        return {\"supported\": False, \"reason\": str(e)}  # degrade gracefully\n    raise","preventionTips":["Do not build RBAC flows against RoleMgr in this version; it is entirely stubbed.","Gate role features behind a capability check instead of assuming API presence."],"tags":["not-implemented","roles","rbac","admin"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}