Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ› Fixes duplicates in tags listings and new priority to enforce order #6479

Merged
merged 17 commits into from
Oct 3, 2024
Prev Previous commit
Next Next commit
doc
pcrespov committed Oct 3, 2024
commit be6f6156344c289f84f877b923e032cbd4a8c4f2
Original file line number Diff line number Diff line change
@@ -14,20 +14,21 @@
"service_key",
sa.String,
nullable=False,
doc="Service Key Identifier",
doc="Key name identifier for the service, without specifiying its versions",
),
sa.Column(
"service_version",
sa.String,
nullable=False,
doc="Service version",
doc="Version of the service. Combined with 'service_key', it forms a unique identifier for this service.",
),
# Tag
sa.Column(
"tag_id",
sa.BigInteger,
sa.ForeignKey(tags.c.id, onupdate="CASCADE", ondelete="CASCADE"),
nullable=False,
doc="Identifier of the tag assigned to this specific service (service_key, service_version).",
),
# Constraints
sa.ForeignKeyConstraint(
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
name="fk_tag_to_group_tag_id",
),
nullable=False,
doc="Tag unique ID",
doc="References the unique identifier of the tag that these access rights apply to.",
),
sa.Column(
"group_id",
@@ -34,30 +34,32 @@
name="fk_tag_to_group_group_id",
),
nullable=False,
doc="Group unique ID",
doc="References the unique identifier of the group that has access rights to the tag.",
),
# ACCESS RIGHTS ---
sa.Column(
"read",
sa.Boolean(),
nullable=False,
server_default=sa.sql.expression.true(),
doc="If true, group can *read* a tag."
"This column can be used to set the tag invisible",
doc="Indicates whether the group has permission to view the tag. "
"A value of 'True' allows the group to access the tag's details.",
),
sa.Column(
"write",
sa.Boolean(),
nullable=False,
server_default=sa.sql.expression.false(),
doc="If true, group can *create* and *update* a tag",
doc="Indicates whether the group has permission to modify the tag. "
"A value of 'True' grants write access to the group.",
),
sa.Column(
"delete",
sa.Boolean(),
nullable=False,
server_default=sa.sql.expression.false(),
doc="If true, group can *delete* the tag",
doc="Indicates whether the group has permission to delete the tag. "
"A value of 'True' allows the group to remove the tag.",
),
# TIME STAMPS ----
column_created_datetime(timezone=False),
Original file line number Diff line number Diff line change
@@ -46,6 +46,10 @@ async def wrapper(request: web.Request) -> web.StreamResponse:

routes = web.RouteTableDef()

#
# tags CRUD standard operations
#


@routes.post(f"/{VTAG}/tags", name="create_tag")
@login_required
@@ -119,6 +123,11 @@ async def list_tag_groups(request: web.Request):
raise NotImplementedError


#
# tags ACCESS RIGHTS is exposed as a sub-resource groups
#


@routes.post(f"/{VTAG}/tags/{{tag_id}}/groups/{{group_id}}", name="create_tag_group")
@login_required
@permission_required("tag.crud.*")