OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Grantee.cpp File Reference
#include "Grantee.h"
#include <stack>
+ Include dependency graph for Grantee.cpp:

Go to the source code of this file.

Functions

static bool hasEnoughPrivs (const DBObject *real, const DBObject *requested)
 
static bool hasAnyPrivs (const DBObject *real, const DBObject *)
 

Function Documentation

static bool hasAnyPrivs ( const DBObject real,
const DBObject  
)
static

Definition at line 186 of file Grantee.cpp.

References DBObject::getPrivileges(), and AccessPrivileges::hasAny().

Referenced by Grantee::hasAnyPrivileges().

186  {
187  if (real) {
188  return real->getPrivileges().hasAny();
189  } else {
190  return false;
191  }
192 }
bool hasAny() const
Definition: DBObject.h:133
const AccessPrivileges & getPrivileges() const
Definition: DBObject.h:202

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool hasEnoughPrivs ( const DBObject real,
const DBObject requested 
)
static

Definition at line 174 of file Grantee.cpp.

References DBObject::getPrivileges(), and AccessPrivileges::privileges.

Referenced by Grantee::checkPrivileges().

174  {
175  if (real) {
176  auto req = requested->getPrivileges().privileges;
177  auto base = real->getPrivileges().privileges;
178 
179  // ensures that all requested privileges are present
180  return req == (base & req);
181  } else {
182  return false;
183  }
184 }
const AccessPrivileges & getPrivileges() const
Definition: DBObject.h:202
int64_t privileges
Definition: DBObject.h:126

+ Here is the call graph for this function:

+ Here is the caller graph for this function: