From 9f43ffc65e3d89c5777db09d8eb6582451d325c3 Mon Sep 17 00:00:00 2001 From: Marcel Canu Date: Wed, 17 Sep 2025 15:01:34 -0300 Subject: [PATCH 1/7] Added permissions to whoami --- label_studio/core/settings/base.py | 2 +- label_studio/users/serializers.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/label_studio/core/settings/base.py b/label_studio/core/settings/base.py index 0fe164623fae..2d06a58d468f 100644 --- a/label_studio/core/settings/base.py +++ b/label_studio/core/settings/base.py @@ -600,7 +600,7 @@ SAVE_USER = 'users.functions.save_user' POST_PROCESS_REIMPORT = 'core.utils.common.empty' USER_SERIALIZER = 'users.serializers.BaseUserSerializer' -WHOAMI_USER_SERIALIZER = USER_SERIALIZER +WHOAMI_USER_SERIALIZER = 'users.serializers.BaseWhoAmIUserSerializer' USER_SERIALIZER_UPDATE = 'users.serializers.BaseUserSerializerUpdate' TASK_SERIALIZER = 'tasks.serializers.BaseTaskSerializer' EXPORT_DATA_SERIALIZER = 'data_export.serializers.BaseExportDataSerializer' diff --git a/label_studio/users/serializers.py b/label_studio/users/serializers.py index 3181d7c8e947..5ab8085a8071 100644 --- a/label_studio/users/serializers.py +++ b/label_studio/users/serializers.py @@ -1,5 +1,6 @@ """This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. """ +from core.permissions import all_permissions from core.utils.common import load_func from django.conf import settings from rest_flex_fields import FlexFieldsModelSerializer @@ -100,6 +101,16 @@ class Meta(BaseUserSerializer.Meta): read_only_fields = ('email',) +class BaseWhoAmIUserSerializer(BaseUserSerializer): + permissions = serializers.SerializerMethodField() + + class Meta(BaseUserSerializer.Meta): + fields = BaseUserSerializer.Meta.fields + ('permissions',) + + def get_permissions(self, user): + return [perm for _, perm in all_permissions] + + class UserSimpleSerializer(BaseUserSerializer): class Meta: model = User From 333fd2fe793762678ce2e47c16e5892c6a1f7e12 Mon Sep 17 00:00:00 2001 From: robot-ci-heartex Date: Wed, 17 Sep 2025 18:44:52 +0000 Subject: [PATCH 2/7] Sync Follow Merge dependencies Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/17807419676 --- poetry.lock | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index 5be45b644de0..b371565b1268 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2136,7 +2136,7 @@ optional = false python-versions = ">=3.9,<4" groups = ["main"] files = [ - {file = "90f4274c21a3ce6304b883b01b14f4aa6af81e41.zip", hash = "sha256:76e026573e83d05ee3b8765805340a58b14e62483a0349448feb72f041ee1ca8"}, + {file = "45dc2ed05de1033d567f0081349f22b117edc199.zip", hash = "sha256:343714843d77a2a42145fddef5cecc21c672d5d61a5ea008b74fbd7ec2149998"}, ] [package.dependencies] @@ -2164,7 +2164,7 @@ xmljson = "0.2.1" [package.source] type = "url" -url = "https://github.com/HumanSignal/label-studio-sdk/archive/90f4274c21a3ce6304b883b01b14f4aa6af81e41.zip" +url = "https://github.com/HumanSignal/label-studio-sdk/archive/45dc2ed05de1033d567f0081349f22b117edc199.zip" [[package]] name = "launchdarkly-server-sdk" @@ -5109,4 +5109,4 @@ uwsgi = ["pyuwsgi", "uwsgitop"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4" -content-hash = "acbad97fcd06d243f46b5a0b8bd8f9392400c9657f97c24979b18c1a6c3d48da" +content-hash = "b2b7ce8aaf70b4fb20853f7570ff1bf943495f0e69e7be3400324f558acda20e" diff --git a/pyproject.toml b/pyproject.toml index ac182c316ead..b314a9f48761 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dependencies = [ "tldextract (>=5.1.3)", "uuid-utils (>=0.11.0,<1.0.0)", ## HumanSignal repo dependencies :start - "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/90f4274c21a3ce6304b883b01b14f4aa6af81e41.zip", + "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/45dc2ed05de1033d567f0081349f22b117edc199.zip", ## HumanSignal repo dependencies :end ] From e3af7bf0c4e205c9dc38eb26b9c1ce52bb6fecf0 Mon Sep 17 00:00:00 2001 From: Marcel Canu Date: Wed, 17 Sep 2025 15:54:18 -0300 Subject: [PATCH 3/7] Added correct typing --- label_studio/users/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/label_studio/users/serializers.py b/label_studio/users/serializers.py index 5ab8085a8071..96b87f8fd7aa 100644 --- a/label_studio/users/serializers.py +++ b/label_studio/users/serializers.py @@ -107,7 +107,7 @@ class BaseWhoAmIUserSerializer(BaseUserSerializer): class Meta(BaseUserSerializer.Meta): fields = BaseUserSerializer.Meta.fields + ('permissions',) - def get_permissions(self, user): + def get_permissions(self, user) -> list[str]: return [perm for _, perm in all_permissions] From 190959b051027aa2c4f6c9095061871d33219cd3 Mon Sep 17 00:00:00 2001 From: robot-ci-heartex Date: Wed, 17 Sep 2025 18:55:01 +0000 Subject: [PATCH 4/7] Sync Follow Merge dependencies Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/17807656960 --- poetry.lock | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index b371565b1268..e9bd0f935ca3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2136,7 +2136,7 @@ optional = false python-versions = ">=3.9,<4" groups = ["main"] files = [ - {file = "45dc2ed05de1033d567f0081349f22b117edc199.zip", hash = "sha256:343714843d77a2a42145fddef5cecc21c672d5d61a5ea008b74fbd7ec2149998"}, + {file = "c8d574c859b630b66460ccee9674a3634acf5bc3.zip", hash = "sha256:c2c74ed1aee44c1c567a34930d25a3e2fff6ca2a701d11ac4f81a3cb77653861"}, ] [package.dependencies] @@ -2164,7 +2164,7 @@ xmljson = "0.2.1" [package.source] type = "url" -url = "https://github.com/HumanSignal/label-studio-sdk/archive/45dc2ed05de1033d567f0081349f22b117edc199.zip" +url = "https://github.com/HumanSignal/label-studio-sdk/archive/c8d574c859b630b66460ccee9674a3634acf5bc3.zip" [[package]] name = "launchdarkly-server-sdk" @@ -5109,4 +5109,4 @@ uwsgi = ["pyuwsgi", "uwsgitop"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4" -content-hash = "b2b7ce8aaf70b4fb20853f7570ff1bf943495f0e69e7be3400324f558acda20e" +content-hash = "4051c6e11ae5fc0444239a1815aa13306f1c0ebaada655dae74229ffc64cb460" diff --git a/pyproject.toml b/pyproject.toml index b314a9f48761..2ed3f01d28d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dependencies = [ "tldextract (>=5.1.3)", "uuid-utils (>=0.11.0,<1.0.0)", ## HumanSignal repo dependencies :start - "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/45dc2ed05de1033d567f0081349f22b117edc199.zip", + "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/c8d574c859b630b66460ccee9674a3634acf5bc3.zip", ## HumanSignal repo dependencies :end ] From bf4b1db194fd22666041a26cdab4d94c82fb8dca Mon Sep 17 00:00:00 2001 From: robot-ci-heartex Date: Wed, 17 Sep 2025 18:57:35 +0000 Subject: [PATCH 5/7] Sync Follow Merge dependencies Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/17807714749 --- poetry.lock | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index e9bd0f935ca3..0e33fd30a610 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2136,7 +2136,7 @@ optional = false python-versions = ">=3.9,<4" groups = ["main"] files = [ - {file = "c8d574c859b630b66460ccee9674a3634acf5bc3.zip", hash = "sha256:c2c74ed1aee44c1c567a34930d25a3e2fff6ca2a701d11ac4f81a3cb77653861"}, + {file = "dc3ccf8831c6e2c359e2a388961d21d2497befa7.zip", hash = "sha256:b0ec6a3d9a3845f54da12341b22d3f2ca6fb26b5821b72bb325ebc595f50310f"}, ] [package.dependencies] @@ -2164,7 +2164,7 @@ xmljson = "0.2.1" [package.source] type = "url" -url = "https://github.com/HumanSignal/label-studio-sdk/archive/c8d574c859b630b66460ccee9674a3634acf5bc3.zip" +url = "https://github.com/HumanSignal/label-studio-sdk/archive/dc3ccf8831c6e2c359e2a388961d21d2497befa7.zip" [[package]] name = "launchdarkly-server-sdk" @@ -5109,4 +5109,4 @@ uwsgi = ["pyuwsgi", "uwsgitop"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4" -content-hash = "4051c6e11ae5fc0444239a1815aa13306f1c0ebaada655dae74229ffc64cb460" +content-hash = "809ecc067a8733b923bbf9335af669eef3b4c48e3ed6438d8e828bdce9e2cba1" diff --git a/pyproject.toml b/pyproject.toml index 2ed3f01d28d0..a593368f95fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dependencies = [ "tldextract (>=5.1.3)", "uuid-utils (>=0.11.0,<1.0.0)", ## HumanSignal repo dependencies :start - "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/c8d574c859b630b66460ccee9674a3634acf5bc3.zip", + "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/dc3ccf8831c6e2c359e2a388961d21d2497befa7.zip", ## HumanSignal repo dependencies :end ] From 54c860765d343112be3dca3488d7b26c01bc2779 Mon Sep 17 00:00:00 2001 From: robot-ci-heartex Date: Wed, 17 Sep 2025 19:01:12 +0000 Subject: [PATCH 6/7] Sync Follow Merge dependencies Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/17807785450 --- poetry.lock | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0e33fd30a610..ec24ef7670fd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2136,7 +2136,7 @@ optional = false python-versions = ">=3.9,<4" groups = ["main"] files = [ - {file = "dc3ccf8831c6e2c359e2a388961d21d2497befa7.zip", hash = "sha256:b0ec6a3d9a3845f54da12341b22d3f2ca6fb26b5821b72bb325ebc595f50310f"}, + {file = "692aab913f6b3ce508b32026a379e0c76cf50dfe.zip", hash = "sha256:9c2830469d5246300af425d82b7b2f7173138e30f4cab35c44a94f7953206e29"}, ] [package.dependencies] @@ -2164,7 +2164,7 @@ xmljson = "0.2.1" [package.source] type = "url" -url = "https://github.com/HumanSignal/label-studio-sdk/archive/dc3ccf8831c6e2c359e2a388961d21d2497befa7.zip" +url = "https://github.com/HumanSignal/label-studio-sdk/archive/692aab913f6b3ce508b32026a379e0c76cf50dfe.zip" [[package]] name = "launchdarkly-server-sdk" @@ -5109,4 +5109,4 @@ uwsgi = ["pyuwsgi", "uwsgitop"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4" -content-hash = "809ecc067a8733b923bbf9335af669eef3b4c48e3ed6438d8e828bdce9e2cba1" +content-hash = "e392b501f3b7ad4921ba392a0ce63f01abc997edc81f7aee430a9671a1de6ff9" diff --git a/pyproject.toml b/pyproject.toml index a593368f95fb..3ccfd6c87b42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dependencies = [ "tldextract (>=5.1.3)", "uuid-utils (>=0.11.0,<1.0.0)", ## HumanSignal repo dependencies :start - "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/dc3ccf8831c6e2c359e2a388961d21d2497befa7.zip", + "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/692aab913f6b3ce508b32026a379e0c76cf50dfe.zip", ## HumanSignal repo dependencies :end ] From 5b10e6705b4654e4e676265f6cbe9507d3085ef7 Mon Sep 17 00:00:00 2001 From: robot-ci-heartex Date: Wed, 17 Sep 2025 19:30:27 +0000 Subject: [PATCH 7/7] Sync Follow Merge dependencies Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/17808494312 --- poetry.lock | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index ec24ef7670fd..57f3f39c238c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2136,7 +2136,7 @@ optional = false python-versions = ">=3.9,<4" groups = ["main"] files = [ - {file = "692aab913f6b3ce508b32026a379e0c76cf50dfe.zip", hash = "sha256:9c2830469d5246300af425d82b7b2f7173138e30f4cab35c44a94f7953206e29"}, + {file = "1be62126853590fb4cdf3bf0c7a3dd92a2c00bcc.zip", hash = "sha256:64761e1dc0d8e1e4f4d1a51f39429c91a5e0ebe599e825bfa65df1602416c9a2"}, ] [package.dependencies] @@ -2164,7 +2164,7 @@ xmljson = "0.2.1" [package.source] type = "url" -url = "https://github.com/HumanSignal/label-studio-sdk/archive/692aab913f6b3ce508b32026a379e0c76cf50dfe.zip" +url = "https://github.com/HumanSignal/label-studio-sdk/archive/1be62126853590fb4cdf3bf0c7a3dd92a2c00bcc.zip" [[package]] name = "launchdarkly-server-sdk" @@ -5109,4 +5109,4 @@ uwsgi = ["pyuwsgi", "uwsgitop"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<4" -content-hash = "e392b501f3b7ad4921ba392a0ce63f01abc997edc81f7aee430a9671a1de6ff9" +content-hash = "a066081c988cd60bdda18fddfb90681e52cd2431bc52042728e86486febfbc5f" diff --git a/pyproject.toml b/pyproject.toml index 3ccfd6c87b42..d1cf18cf0f1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dependencies = [ "tldextract (>=5.1.3)", "uuid-utils (>=0.11.0,<1.0.0)", ## HumanSignal repo dependencies :start - "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/692aab913f6b3ce508b32026a379e0c76cf50dfe.zip", + "label-studio-sdk @ https://github.com/HumanSignal/label-studio-sdk/archive/1be62126853590fb4cdf3bf0c7a3dd92a2c00bcc.zip", ## HumanSignal repo dependencies :end ]