{"record":{"id":"80fd43c8e19169e0","repo":"HumanSignal/label-studio","slug":"add-or-update-columns-is-not-enabled-for-this-orga","errorCode":null,"errorMessage":"Add or Update Columns is not enabled for this organization.","messagePattern":"Add or Update Columns is not enabled for this organization\\.","errorType":"validation","errorClass":"PermissionDenied","httpStatus":403,"severity":"error","filePath":"label_studio/data_manager/actions/data_columns.py","lineNumber":226,"sourceCode":"\n    job = start_job_async_or_sync(\n        _complete_column_mutation_job,\n        project.id,\n        mode,\n        value_name,\n        value,\n        value_type,\n        mutation_scope,\n        queue_name='low',\n        job_timeout=60 * 60,\n    )\n    return hasattr(job, 'id')\n\n\ndef add_data_field(project, queryset, **kwargs):\n    request = kwargs['request']\n    if not add_or_modify_columns_enabled(project):\n        raise PermissionDenied('Add or Update Columns is not enabled for this organization.')\n\n    mode, value_name, value_type, value = _validate_column_request(request.data, project)\n    selected_size = queryset.count()\n\n    if _can_stage_column_mutation(project, queryset, mode):\n        mutation_scope = _serialize_mutation_scope(kwargs.get('prepare_params'))\n        is_async = _stage_column_mutation(\n            project, queryset, mutation_scope, request.data, mode, value_name, value, value_type\n        )\n        return {\n            'response_code': 200,\n            'async': is_async,\n            'reload': False,\n            'column_operation': mode,\n            'manual_refresh_required': True,\n            'detail': 'Updated the current page. The remaining tasks are being updated in the background.',\n        }\n","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/data_manager/actions/data_columns.py#L208-L244","documentation":"add_data_field first checks the feature flag add_or_modify_columns_enabled(project). If the Add/Update Columns capability is not enabled for the project's organization, PermissionDenied is raised before any validation or mutation happens. This is an entitlement/feature-flag gate, not a user-role problem.","triggerScenarios":"Invoking the 'add_data_field' Data Manager action on an organization without the add-or-modify-columns flag enabled (e.g. community/open-source install or a plan lacking the feature).","commonSituations":"Tests or scripts written against an enterprise instance run on a self-hosted OSS instance; organization upgraded/downgraded so the flag changed; flag not enabled in license/config for the org.","solutions":["Enable the Add or Update Columns feature flag for the organization (license/entitlement or org setting, per add_or_modify_columns_enabled).","Upgrade to a plan/edition that includes the feature.","Skip the action in clients unless the flag is confirmed enabled for the org."],"exampleFix":"// before\n// call add_data_field action on OSS instance -> PermissionDenied\n// after\n// deploy Label Studio enterprise / enable the feature for the organization before calling the action","handlingStrategy":"try-catch","validationCode":"from label_studio.data_manager.actions.data_columns import add_or_modify_columns_enabled\nif not add_or_modify_columns_enabled(project):\n    raise SkipAction('Add/Update Columns not enabled for this organization')","typeGuard":null,"tryCatchPattern":"from rest_framework.exceptions import PermissionDenied\ntry:\n    add_data_field(project, qs, request=request)\nexcept PermissionDenied:\n    notify_org_admin_to_enable_feature()\n    return","preventionTips":["Check add_or_modify_columns_enabled(project) before offering the action in the UI.","Confirm the organization's license/plan includes the feature.","Gate automated scripts on the same flag used server-side."],"tags":["permissions","feature-flag","data-manager","entitlement"],"backgroundTag":"feature-not-enabled","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}