Add policies for project tokens to interact with builds api
@@ -21,6 +21,13 @@ allow {
build_collaborator([api.token.user.id, project])
}
+allow {
+ api.method = "GET"
+ api.path = ["api", "v1", "projects", project, "builds", _, "restart"]
+ api.token.type = "project"
+ project = api.token.project.id
+}
+
allow {
api.method = "GET"
api.path = ["api", "v1", "projects", project, "builds", _, "abort"]
@@ -28,6 +35,13 @@ allow {
build_collaborator([api.token.user.id, project])
}
+allow {
+ api.method = "GET"
+ api.path = ["api", "v1", "projects", project, "builds", _, "abort"]
+ api.token.type = "project"
+ project = api.token.project.id
+}
+
allow {
api.method = "GET"
api.path = ["api", "v1", "projects", project, "builds", _, "cache", "clear"]
@@ -49,6 +63,13 @@ allow {
build_project_public(project)
}
+allow {
+ api.method = "GET"
+ api.path = ["api", "v1", "projects", project, "builds", _, _, "state"]
+ api.token.type = "project"
+ project = api.token.project.id
+}
+
allow {
api.method = "GET"
api.path = ["api", "v1", "projects", project, "builds", _, _]
