Skip to content
Discussion options

You must be logged in to vote

Hey, thanks for the clear question. This is a good one.

Graphs passed to graph.reachable need to be a list of all nodes and the other nodes they have edges to. This list of edges might be an empty list.

I would set it up more like this:

package foo
# nodes is a set of unique roles and grant names
nodes contains node if {
	some role, role_data in data.relations.roles
	grant_names := {n | some n in role_data.grants}
	# a node is both the role itself and all the grant names
	some node in (grant_names | {role})
}

inherits_from_graph[node] := edges if {
	some node in nodes
	edges := {e | some e in data.relations.roles[node].grants}
}

effective_permissions := graph.reachable(inherits_from_gra…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@philip-couling-oxa
Comment options

@philip-couling-oxa
Comment options

@charlieegan3
Comment options

@philip-couling-oxa
Comment options

@charlieegan3
Comment options

Answer selected by philip-couling-oxa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants