00001 #ifndef __ACC_AUTHORIZE__ 00002 #define __ACC_AUTHORIZE__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d A c c A u t h o r i z e . h h */ 00006 /* */ 00007 /* (c) 2000 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* You should have received a copy of the GNU Lesser General Public License */ 00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00026 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00027 /* */ 00028 /* The copyright holder's institutional names and contributor's names may not */ 00029 /* be used to endorse or promote products derived from this software without */ 00030 /* specific prior written permission of the institution or contributor. */ 00031 /******************************************************************************/ 00032 00033 #include "XrdAcc/XrdAccPrivs.hh" 00034 00035 /******************************************************************************/ 00036 /* A c c e s s _ O p e r a t i o n */ 00037 /******************************************************************************/ 00038 00040 00041 enum Access_Operation {AOP_Any = 0, 00042 AOP_Chmod = 1, 00043 AOP_Chown = 2, 00044 AOP_Create = 3, 00045 AOP_Delete = 4, 00046 AOP_Insert = 5, 00047 AOP_Lock = 6, 00048 AOP_Mkdir = 7, 00049 AOP_Read = 8, 00050 AOP_Readdir = 9, 00051 AOP_Rename = 10, 00052 AOP_Stat = 11, 00053 AOP_Update = 12, 00054 AOP_LastOp = 12 // For limits testing 00055 }; 00056 00057 /******************************************************************************/ 00058 /* X r d A c c A u t h o r i z e */ 00059 /******************************************************************************/ 00060 00061 class XrdOucEnv; 00062 class XrdSecEntity; 00063 class XrdSysLogger; 00064 00065 class XrdAccAuthorize 00066 { 00067 public: 00068 00069 //------------------------------------------------------------------------------ 00084 //------------------------------------------------------------------------------ 00085 00086 virtual XrdAccPrivs Access(const XrdSecEntity *Entity, 00087 const char *path, 00088 const Access_Operation oper, 00089 XrdOucEnv *Env=0) = 0; 00090 00091 //------------------------------------------------------------------------------ 00107 //------------------------------------------------------------------------------ 00108 00109 virtual int Audit(const int accok, 00110 const XrdSecEntity *Entity, 00111 const char *path, 00112 const Access_Operation oper, 00113 XrdOucEnv *Env=0) = 0; 00114 00115 //------------------------------------------------------------------------------ 00123 //------------------------------------------------------------------------------ 00124 00125 virtual int Test(const XrdAccPrivs priv, 00126 const Access_Operation oper) = 0; 00127 00128 //------------------------------------------------------------------------------ 00130 //------------------------------------------------------------------------------ 00131 00132 XrdAccAuthorize() {} 00133 00134 //------------------------------------------------------------------------------ 00136 //------------------------------------------------------------------------------ 00137 00138 virtual ~XrdAccAuthorize() {} 00139 }; 00140 00141 /******************************************************************************/ 00142 /* X r d A c c A u t h o r i z e O b j e c t */ 00143 /******************************************************************************/ 00144 00145 //------------------------------------------------------------------------------ 00160 //------------------------------------------------------------------------------ 00161 00162 typedef XrdAccAuthorize *(*XrdAccAuthorizeObject_t)(XrdSysLogger *lp, 00163 const char *cfn, 00164 const char *parm); 00165 00166 00172 //------------------------------------------------------------------------------ 00190 //------------------------------------------------------------------------------ 00191 00192 typedef XrdAccAuthorize *(*XrdAccAuthorizeObjAdd_t)(XrdSysLogger *lp, 00193 const char *cfn, 00194 const char *parm, 00195 XrdOucEnv *envP, 00196 XrdAccAuthorize *accP); 00197 00198 00206 //------------------------------------------------------------------------------ 00212 //------------------------------------------------------------------------------ 00213 00223 #endif