MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / validate_owners

Method validate_owners

api/features/serializers.py:327–339  ·  view source on GitHub ↗
(self, owners: list[FFAdminUser])

Source from the content-addressed store, hash-verified

325 return multivariate_options
326
327 def validate_owners(self, owners: list[FFAdminUser]) -> list[FFAdminUser]:
328 project: Project = self.context["project"]
329 invalid_users = [
330 user
331 for user in owners
332 if not user.has_project_permission(VIEW_PROJECT, project)
333 ]
334 if invalid_users:
335 invalid_user_ids = [user.id for user in invalid_users]
336 raise serializers.ValidationError(
337 f"Users with ids {invalid_user_ids} do not have access to this project."
338 )
339 return owners
340
341 def validate_group_owners(
342 self, group_owners: list[UserPermissionGroup]

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected