Another question: How can I get all permissions of...
# help
t
Another question: How can I get all permissions of a principal over a resource programmatically in cerbos-sdk like this def what_permissions_has(principal:Principal, resource_name:str)->list[str]: ... what_permissions_has(principalA, "book") # ["borrow", "buy"] It should read from policies and give answer
a
You can't get all the permissions but you can do a check resources request with multiple actions. So in this case you'd feed in all the permissions you're interested in checking and get back allows or denies for each of them.
❤️ 1
t
Yes I see. Does batch_check take time = n * single_check_time where n is the number of actions to check? I means without counting of http traversal time.
a
Hi, sorry, missed your reply! The answer is "it depends"... for a small batch (<= 4 inputs) then yes, but for larger batches Cerbos will parallelise the checks according to the number of CPU cores available.