fix project rego
@@ -7,21 +7,14 @@ import data.infrabox.projects.projects
import input as http_api
project_owner[[user, project]]{
- project_collaborator[[user, project]][i]
+ collaborators[i].project_id = project
+ collaborators[i].user_id = user
collaborators[i].role = "Owner"
}
project_collaborator[[user, project]]{
- user_projects[i] = project_collaborators[j]
-}
-
-user_projects[user]{
- user = collaborators[i].user_id
-}
-
-project_collaborators[project]{
- project = projects[_].id
- project = collaborators[_].project_id
+ collaborators[i].project_id = project
+ collaborators[i].user_id = user
}
allow {
