OmniSciDB  085a039ca4
 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 199 of file Grantee.cpp.

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

Referenced by Grantee::hasAnyPrivileges().

199  {
200  if (real) {
201  return real->getPrivileges().hasAny();
202  } else {
203  return false;
204  }
205 }
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 187 of file Grantee.cpp.

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

Referenced by Grantee::checkPrivileges().

187  {
188  if (real) {
189  auto req = requested->getPrivileges().privileges;
190  auto base = real->getPrivileges().privileges;
191 
192  // ensures that all requested privileges are present
193  return req == (base & req);
194  } else {
195  return false;
196  }
197 }
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: