MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ACLSetUserCommandBit

Function ACLSetUserCommandBit

app/redis-6.2.6/src/acl.c:397–406  ·  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

395 * zero, the user flag ALLCOMMANDS is cleared since it is no longer possible
396 * to skip the command bit explicit test. */
397void ACLSetUserCommandBit(user *u, unsigned long id, int value) {
398 uint64_t word, bit;
399 if (ACLGetCommandBitCoordinates(id,&word,&bit) == C_ERR) return;
400 if (value) {
401 u->allowed_commands[word] |= bit;
402 } else {
403 u->allowed_commands[word] &= ~bit;
404 u->flags &= ~USER_FLAG_ALLCOMMANDS;
405 }
406}
407
408/* This is like ACLSetUserCommandBit(), but instead of setting the specified
409 * 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