Loading...
Searching...
No Matches
XrdAccAuthorize.hh
Go to the documentation of this file.
#ifndef __ACC_AUTHORIZE__
#define __ACC_AUTHORIZE__
/******************************************************************************/
/* */
/* X r d A c c A u t h o r i z e . h h */
/* */
/* (c) 2000 by the Board of Trustees of the Leland Stanford, Jr., University */
/* All Rights Reserved */
/* Produced by Andrew Hanushevsky for Stanford University under contract */
/* DE-AC02-76-SFO0515 with the Department of Energy */
/* */
/* This file is part of the XRootD software suite. */
/* */
/* XRootD is free software: you can redistribute it and/or modify it under */
/* the terms of the GNU Lesser General Public License as published by the */
/* Free Software Foundation, either version 3 of the License, or (at your */
/* option) any later version. */
/* */
/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
/* License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
/* */
/* The copyright holder's institutional names and contributor's names may not */
/* be used to endorse or promote products derived from this software without */
/* specific prior written permission of the institution or contributor. */
/******************************************************************************/
#include "XrdAcc/XrdAccPrivs.hh"
/******************************************************************************/
/* A c c e s s _ O p e r a t i o n */
/******************************************************************************/
enum Access_Operation {AOP_Any = 0,
AOP_Chmod = 1,
AOP_Chown = 2,
AOP_Create = 3,
AOP_Delete = 4,
AOP_Insert = 5,
AOP_Lock = 6,
AOP_Mkdir = 7,
AOP_Read = 8,
AOP_Readdir = 9,
AOP_Rename = 10,
AOP_Stat = 11,
AOP_Update = 12,
AOP_Excl_Create = 13,
AOP_Excl_Insert = 14,
AOP_LastOp = 14 // For limits testing
};
/******************************************************************************/
/* X r d A c c A u t h o r i z e */
/******************************************************************************/
class XrdOucEnv;
class XrdSecEntity;
class XrdSysLogger;
class XrdAccAuthorize
{
public:
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
virtual XrdAccPrivs Access(const XrdSecEntity *Entity,
const char *path,
const Access_Operation oper,
XrdOucEnv *Env=0) = 0;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
virtual int Audit(const int accok,
const XrdSecEntity *Entity,
const char *path,
const Access_Operation oper,
XrdOucEnv *Env=0) = 0;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
virtual int Test(const XrdAccPrivs priv,
const Access_Operation oper) = 0;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
XrdAccAuthorize() {}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
virtual ~XrdAccAuthorize() {}
};
/******************************************************************************/
/* X r d A c c A u t h o r i z e O b j e c t */
/******************************************************************************/
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
typedef XrdAccAuthorize *(*XrdAccAuthorizeObject_t)(XrdSysLogger *lp,
const char *cfn,
const char *parm);
// Alternatively:
typedef XrdAccAuthorize *(*XrdAccAuthorizeObject2_t)(XrdSysLogger *lp,
const char *cfn,
const char *parm,
XrdOucEnv *envP);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
typedef XrdAccAuthorize *(*XrdAccAuthorizeObjAdd_t)(XrdSysLogger *lp,
const char *cfn,
const char *parm,
XrdOucEnv *envP,
XrdAccAuthorize *accP);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#endif
Access_Operation
Access_Operation
The following are supported operations.
Definition XrdAccAuthorize.hh:41
AOP_Delete
@ AOP_Delete
rm() or rmdir()
Definition XrdAccAuthorize.hh:45
AOP_Mkdir
@ AOP_Mkdir
mkdir()
Definition XrdAccAuthorize.hh:48
AOP_Update
@ AOP_Update
open() r/w or append
Definition XrdAccAuthorize.hh:53
AOP_Create
@ AOP_Create
open() with create
Definition XrdAccAuthorize.hh:44
AOP_Readdir
@ AOP_Readdir
opendir()
Definition XrdAccAuthorize.hh:50
AOP_Chmod
@ AOP_Chmod
chmod()
Definition XrdAccAuthorize.hh:42
AOP_Any
@ AOP_Any
Special for getting privs.
Definition XrdAccAuthorize.hh:41
AOP_Stat
@ AOP_Stat
exists(), stat()
Definition XrdAccAuthorize.hh:52
AOP_LastOp
@ AOP_LastOp
Definition XrdAccAuthorize.hh:56
AOP_Rename
@ AOP_Rename
mv() for source
Definition XrdAccAuthorize.hh:51
AOP_Read
@ AOP_Read
open() r/o, prepare()
Definition XrdAccAuthorize.hh:49
AOP_Excl_Create
@ AOP_Excl_Create
open() with O_EXCL|O_CREAT
Definition XrdAccAuthorize.hh:54
AOP_Insert
@ AOP_Insert
mv() for target
Definition XrdAccAuthorize.hh:46
AOP_Lock
@ AOP_Lock
n/a
Definition XrdAccAuthorize.hh:47
AOP_Chown
@ AOP_Chown
chown()
Definition XrdAccAuthorize.hh:43
AOP_Excl_Insert
@ AOP_Excl_Insert
mv() where destination doesn't exist.
Definition XrdAccAuthorize.hh:55
XrdAccPrivs.hh
XrdAccPrivs
XrdAccPrivs
Definition XrdAccPrivs.hh:39
XrdAccAuthorize
Definition XrdAccAuthorize.hh:68
XrdAccAuthorize::Test
virtual int Test(const XrdAccPrivs priv, const Access_Operation oper)=0
XrdAccAuthorize::Audit
virtual int Audit(const int accok, const XrdSecEntity *Entity, const char *path, const Access_Operation oper, XrdOucEnv *Env=0)=0
XrdAccAuthorize::~XrdAccAuthorize
virtual ~XrdAccAuthorize()
Destructor.
Definition XrdAccAuthorize.hh:140
XrdAccAuthorize::XrdAccAuthorize
XrdAccAuthorize()
Constructor.
Definition XrdAccAuthorize.hh:134
XrdAccAuthorize::Access
virtual XrdAccPrivs Access(const XrdSecEntity *Entity, const char *path, const Access_Operation oper, XrdOucEnv *Env=0)=0
XrdOucEnv
Definition XrdOucEnv.hh:42
XrdSecEntity
Definition XrdSecEntity.hh:65
XrdSysLogger
Definition XrdSysLogger.hh:53