From b270322ff9d008ceafcaac68a89967d2b34d8626 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 23 Jan 2019 08:14:56 +0100 Subject: [PATCH] ACL: ACLUserCanExecuteFutureCommands() function added. --- src/acl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/acl.c b/src/acl.c index 07b037b2..b2bc23fd 100644 --- a/src/acl.c +++ b/src/acl.c @@ -141,6 +141,13 @@ int ACLGetUserCommandBit(user *u, unsigned long id) { return u->allowed_commands[word] & bit; } +/* When +@all or allcommands is given, we set a reserved bit as well that we + * can later test, to see if the user has the right to execute "future commands", + * that is, commands loaded later via modules. */ +int ACLUserCanExecuteFutureCommands(user *u) { + return ACLGetUserCommandBit(u,USER_COMMAND_BITS_COUNT-1); +} + /* Set the specified command bit for the specified user to 'value' (0 or 1). * If the bit overflows the user internal represetation, no operation * is performed. */