summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-01-19 08:11:01 +0000
committerSadie Powell <sadie@witchery.services>2021-01-19 08:11:01 +0000
commitebe3e3f3cfef79e5b92b4c1d8fc9913dac4ddf43 (patch)
tree418db275b4c265dcdf98b7bad1c1bfa1de51dbc6 /include
parent28fef58b882e34369c935d56cb4ac50429cba8c7 (diff)
Allow converting a Cap::Reference to a Cap::Capability*.
Diffstat (limited to 'include')
-rw-r--r--include/modules/cap.h6
1 files changed, 6 insertions, 0 deletions
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