Skip to content

Commit

Permalink
CA-402654: Partially revert 3e2e970 (#6131)
Browse files Browse the repository at this point in the history
A module binding appeared to be unused but was being evaluated for its
effect alone. We reintroduce it here and don't bind a name.
  • Loading branch information
contificate authored Nov 22, 2024
2 parents 7c62ede + 860843f commit 8f49371
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ocaml/xapi/rbac.ml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ let assert_permission_name ~__context ~permission =
let assert_permission ~__context ~permission =
assert_permission_name ~__context ~permission:permission.role_name_label

(* Populates assert_permission_fn on behalf of TaskHelper to
avoid a dependency cycle. *)
let () =
if !TaskHelper.rbac_assert_permission_fn = None then
TaskHelper.rbac_assert_permission_fn := Some assert_permission

let has_permission_name ~__context ~permission =
let session_id = get_session_of_context ~__context ~permission in
is_access_allowed ~__context ~session_id ~permission
Expand Down

0 comments on commit 8f49371

Please sign in to comment.