OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Grantee.cpp File Reference
#include "Grantee.h"
#include <stack>
#include "Shared/misc.h"
+ 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 189 of file Grantee.cpp.

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

Referenced by Grantee::hasAnyPrivileges().

189  {
190  if (real) {
191  return real->getPrivileges().hasAny();
192  } else {
193  return false;
194  }
195 }
bool hasAny() const
Definition: DBObject.h:142
const AccessPrivileges & getPrivileges() const
Definition: DBObject.h:228

+ 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 177 of file Grantee.cpp.

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

Referenced by Grantee::checkPrivileges().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function: