From 10c486e996dd58c3470a56f2274d84e3ad792972 Mon Sep 17 00:00:00 2001 From: Jorens Shtekels Date: Sun, 10 Mar 2024 21:16:10 +0200 Subject: [PATCH] feat: action belongs to role check --- src/lib.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.cpp b/src/lib.cpp index 0a8ad8a..4b3576e 100644 --- a/src/lib.cpp +++ b/src/lib.cpp @@ -53,9 +53,7 @@ int validateAction( } bool actionBelongsToRole(Role *role, Action *action) { - // TODO: implement - bool belongs = false; - return belongs; + return std::find(role->actions.begin(), role->actions.end(), *action) != role->actions.end(); } bool isActionAllowed(Action *action, std::vector *relevantEvents) {