Back to index

nordugrid-arc-nox  1.1.0~rc6
Defines | Functions
gacl.h File Reference
#include <arc/XMLNode.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define GACL_PERM_NONE   0
#define GACL_PERM_READ   1
#define GACL_PERM_LIST   2
#define GACL_PERM_WRITE   4
#define GACL_PERM_ADMIN   8
#define GACL_PERM_ALL   15


int GACLEvaluate (Arc::XMLNode gacl, Arc::XMLNode subject)

Define Documentation

#define GACL_PERM_ADMIN   8

Definition at line 7 of file gacl.h.

#define GACL_PERM_ALL   15

Definition at line 8 of file gacl.h.

#define GACL_PERM_LIST   2

Definition at line 5 of file gacl.h.

#define GACL_PERM_NONE   0

Definition at line 3 of file gacl.h.

#define GACL_PERM_READ   1

Definition at line 4 of file gacl.h.

#define GACL_PERM_WRITE   4

Definition at line 6 of file gacl.h.

Function Documentation

int GACLEvaluate ( Arc::XMLNode  gacl,
Arc::XMLNode  subject 

Definition at line 28 of file gacl.cpp.

  if(!MatchXMLName(gacl,"gacl")) return GACL_PERM_NONE;
  int perm_allow = GACL_PERM_NONE;
  int perm_deny = GACL_PERM_NONE;
  Arc::XMLNode entry = gacl["entry"];
  for(;(bool)entry;entry=entry[1]) {
    if(match_entity(entry,subject)) {
      Arc::XMLNode allow = entry["allow"];
      if(allow) {
        if(allow["read"])  perm_allow=GACL_PERM_READ;
        if(allow["list"])  perm_allow=GACL_PERM_LIST;
        if(allow["write"]) perm_allow=GACL_PERM_WRITE;
        if(allow["admin"]) perm_allow=GACL_PERM_ADMIN;
      Arc::XMLNode deny = entry["deny"];
      if(deny) {
        if(deny["read"])  perm_deny=GACL_PERM_READ;
        if(deny["list"])  perm_deny=GACL_PERM_LIST;
        if(deny["write"]) perm_deny=GACL_PERM_WRITE;
        if(deny["admin"]) perm_deny=GACL_PERM_ADMIN;
  return perm_allow & (~perm_deny);

Here is the call graph for this function: