From ebe3e3f3cfef79e5b92b4c1d8fc9913dac4ddf43 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 19 Jan 2021 08:11:01 +0000 Subject: Allow converting a Cap::Reference to a Cap::Capability*. --- include/modules/cap.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/modules/cap.h') diff --git a/include/modules/cap.h b/include/modules/cap.h index 9dacdc200..664120d39 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -304,6 +304,12 @@ namespace Cap { } + /** Retrieves the underlying cap. */ + operator const Cap::Capability*() const + { + return ref ? *ref : NULL; + } + /** Check whether a user has the referenced capability turned on. * @param user User to check * @return True if the user is using the referenced capability, false otherwise -- cgit v1.2.3