MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ACLSetUserCommandBit

Function ACLSetUserCommandBit

src/acl.cpp:406–415  ·  view source on GitHub ↗

Set the specified command bit for the specified user to 'value' (0 or 1). * If the bit overflows the user internal representation, no operation * is performed. As a side effect of calling this function with a value of * zero, the user flag ALLCOMMANDS is cleared since it is no longer possible * to skip the command bit explicit test. */

Source from the content-addressed store, hash-verified

404 * zero, the user flag ALLCOMMANDS is cleared since it is no longer possible
405 * to skip the command bit explicit test. */
406void ACLSetUserCommandBit(user *u, unsigned long id, int value) {
407 uint64_t word=0, bit=0;
408 if (ACLGetCommandBitCoordinates(id,&word,&bit) == C_ERR) return;
409 if (value) {
410 u->allowed_commands[word] |= bit;
411 } else {
412 u->allowed_commands[word] &= ~bit;
413 u->flags &= ~USER_FLAG_ALLCOMMANDS;
414 }
415}
416
417/* This is like ACLSetUserCommandBit(), but instead of setting the specified
418 * ID, it will check all the commands in the category specified as argument,

Callers 3

ACLSetUserFunction · 0.85

Calls 1

Tested by

no test coverage detected