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 00064 class XrdAccAuthorize 00065 { 00066 public: 00067 00068 //------------------------------------------------------------------------------ 00083 //------------------------------------------------------------------------------ 00084 00085 virtual XrdAccPrivs Access(const XrdSecEntity *Entity, 00086 const char *path, 00087 const Access_Operation oper, 00088 XrdOucEnv *Env=0) = 0; 00089 00090 //------------------------------------------------------------------------------ 00106 //------------------------------------------------------------------------------ 00107 00108 virtual int Audit(const int accok, 00109 const XrdSecEntity *Entity, 00110 const char *path, 00111 const Access_Operation oper, 00112 XrdOucEnv *Env=0) = 0; 00113 00114 //------------------------------------------------------------------------------ 00122 //------------------------------------------------------------------------------ 00123 00124 virtual int Test(const XrdAccPrivs priv, 00125 const Access_Operation oper) = 0; 00126 00127 //------------------------------------------------------------------------------ 00129 //------------------------------------------------------------------------------ 00130 00131 XrdAccAuthorize() {} 00132 00133 //------------------------------------------------------------------------------ 00135 //------------------------------------------------------------------------------ 00136 00137 virtual ~XrdAccAuthorize() {} 00138 }; 00139 00140 /******************************************************************************/ 00141 /* X r d A c c A u t h o r i z e O b j e c t */ 00142 /******************************************************************************/ 00143 00144 //------------------------------------------------------------------------------ 00159 //------------------------------------------------------------------------------ 00160 00166 //------------------------------------------------------------------------------ 00172 //------------------------------------------------------------------------------ 00173 00183 #endif