diff options
| author | 2021-07-16 18:39:47 +0100 | |
|---|---|---|
| committer | 2021-07-16 18:39:47 +0100 | |
| commit | fcc7b7cdb4a0d85cb021013f5db8a558f9c13c25 (patch) | |
| tree | 9bbd8acbc6a5581d9bc879ef452773f74fb3811a /include/modules/cap.h | |
| parent | Merge branch 'insp3' into master. (diff) | |
Allow toggling a capability from a Cap::Reference.
Diffstat (limited to 'include/modules/cap.h')
| -rw-r--r-- | include/modules/cap.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/modules/cap.h b/include/modules/cap.h index 150393520..2336ef486 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -319,6 +319,17 @@ namespace Cap return ref->IsEnabled(user); return false; } + + /** Turn the capability on/off for a user. If the cap is not registered this method has no effect. + * @param user User to turn the cap on/off for + * @param val True to turn the cap on, false to turn it off + */ + void Set(User* user, bool val) + { + if (ref) + ref->Set(user, val); + } + }; class MessageBase : public ClientProtocol::Message |
