Fix builds access for public projects
@@ -9,6 +9,11 @@ build_collaborator([user, project]) {
collaborators[i].user_id = user
}
+build_project_public(project){
+ projects[i].id = project
+ projects[i].public = true
+}
+
allow {
api.method = "GET"
api.path = ["api", "v1", "projects", project, "builds", _, "restart"]
@@ -37,6 +42,13 @@ allow {
build_collaborator([api.token.user.id, project])
}
+allow {
+ api.method = "GET"
+ api.path = ["api", "v1", "projects", project, "builds", _, _, "state"]
+ api.token.type = "user"
+ build_project_public(project)
+}
+
allow {
api.method = "GET"
api.path = ["api", "v1", "projects", project, "builds", _, _]
@@ -44,6 +56,12 @@ allow {
build_collaborator([api.token.user.id, project])
}
+allow {
+ api.method = "GET"
+ api.path = ["api", "v1", "projects", project, "builds", _, _]
+ build_project_public( project )
+}
+
allow {
api.method = "GET"
api.path = ["api", "v1", "projects", project, "builds"]
