Fix project_name bug for collaborator
@@ -27,6 +27,11 @@ projects_projects_name_public(project){
projects[i].public = true
}
+projects_projects_name_collaborator([user, project]){
+ projects[i].name = project
+ collaborators[i].user_id = user
+}
+
allow {
api.method = "GET"
api.path = ["api", "v1", "projects"]
@@ -45,6 +50,13 @@ allow {
projects_projects_name_public(project_name)
}
+allow {
+ api.method = "GET"
+ api.path = ["api", "v1", "projects", "name", project_name]
+ api.token.type = "user"
+ projects_projects_collaborator([api.token.user.id, project_name])
+}
+
allow {
api.method = "GET"
api.path = ["api", "v1", "projects", project]
