Allow toggling a capability from a Cap::Reference.

This commit is contained in:
Sadie Powell 2021-07-16 18:39:47 +01:00
parent 5bc4720d55
commit fcc7b7cdb4

View File

@ -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