XRootD
XrdAccAuthorize.hh
Go to the documentation of this file.
1 #ifndef __ACC_AUTHORIZE__
2 #define __ACC_AUTHORIZE__
3 /******************************************************************************/
4 /* */
5 /* X r d A c c A u t h o r i z e . h h */
6 /* */
7 /* (c) 2000 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 #include "XrdAcc/XrdAccPrivs.hh"
34 
35 /******************************************************************************/
36 /* A c c e s s _ O p e r a t i o n */
37 /******************************************************************************/
38 
40 
42  AOP_Chmod = 1,
43  AOP_Chown = 2,
44  AOP_Create = 3,
45  AOP_Delete = 4,
46  AOP_Insert = 5,
47  AOP_Lock = 6,
48  AOP_Mkdir = 7,
49  AOP_Read = 8,
51  AOP_Rename = 10,
52  AOP_Stat = 11,
53  AOP_Update = 12,
56  AOP_Stage = 15,
57  AOP_Poll = 16,
58  AOP_LastOp = 16 // For limits testing
59  };
60 
61 /******************************************************************************/
62 /* X r d A c c A u t h o r i z e */
63 /******************************************************************************/
64 
65 #include <string>
66 
67 class XrdOucEnv;
68 class XrdSecEntity;
69 class XrdSysLogger;
70 
72 {
73 public:
74 
75 //------------------------------------------------------------------------------
90 //------------------------------------------------------------------------------
91 
92 virtual XrdAccPrivs Access(const XrdSecEntity *Entity,
93  const char *path,
94  const Access_Operation oper,
95  XrdOucEnv *Env=0) = 0;
96 
97 //------------------------------------------------------------------------------
115 //------------------------------------------------------------------------------
116 
117 virtual XrdAccPrivs Access(const XrdSecEntity *Entity,
118  const char *path,
119  const Access_Operation oper,
120  std::string &eInfo,
121  XrdOucEnv *Env=0)
122  {return Access(Entity, path, oper, Env);}
123 
124 //------------------------------------------------------------------------------
140 //------------------------------------------------------------------------------
141 
142 virtual int Audit(const int accok,
143  const XrdSecEntity *Entity,
144  const char *path,
145  const Access_Operation oper,
146  XrdOucEnv *Env=0) = 0;
147 
148 //------------------------------------------------------------------------------
156 //------------------------------------------------------------------------------
157 
158 virtual int Test(const XrdAccPrivs priv,
159  const Access_Operation oper) = 0;
160 
161 //------------------------------------------------------------------------------
163 //------------------------------------------------------------------------------
164 
166 
167 //------------------------------------------------------------------------------
169 //------------------------------------------------------------------------------
170 
171 virtual ~XrdAccAuthorize() {}
172 };
173 
174 /******************************************************************************/
175 /* X r d A c c A u t h o r i z e O b j e c t */
176 /******************************************************************************/
177 
178 //------------------------------------------------------------------------------
196 //------------------------------------------------------------------------------
197 
198 typedef XrdAccAuthorize *(*XrdAccAuthorizeObject_t)(XrdSysLogger *lp,
199  const char *cfn,
200  const char *parm);
201 
202 
208 // Alternatively:
209 
210 typedef XrdAccAuthorize *(*XrdAccAuthorizeObject2_t)(XrdSysLogger *lp,
211  const char *cfn,
212  const char *parm,
213  XrdOucEnv *envP);
214 
215 
222 //------------------------------------------------------------------------------
240 //------------------------------------------------------------------------------
241 
242 typedef XrdAccAuthorize *(*XrdAccAuthorizeObjAdd_t)(XrdSysLogger *lp,
243  const char *cfn,
244  const char *parm,
245  XrdOucEnv *envP,
246  XrdAccAuthorize *accP);
247 
248 
256 //------------------------------------------------------------------------------
262 //------------------------------------------------------------------------------
263 
273 #endif
Access_Operation
The following are supported operations.
@ AOP_Delete
rm() or rmdir()
@ AOP_Mkdir
mkdir()
@ AOP_Update
open() r/w or append
@ AOP_Create
open() with create
@ AOP_Readdir
opendir()
@ AOP_Chmod
chmod()
@ AOP_Any
Special for getting privs.
@ AOP_Stat
exists(), stat()
@ AOP_LastOp
@ AOP_Poll
stage polling operations
@ AOP_Rename
mv() for source
@ AOP_Read
open() r/o, prepare()
@ AOP_Excl_Create
open() with O_EXCL|O_CREAT
@ AOP_Insert
mv() for target
@ AOP_Lock
n/a
@ AOP_Chown
chown()
@ AOP_Stage
stage and or read data, plus related operations
@ AOP_Excl_Insert
mv() where destination doesn't exist.
XrdAccPrivs
Definition: XrdAccPrivs.hh:39
virtual int Test(const XrdAccPrivs priv, const Access_Operation oper)=0
virtual XrdAccPrivs Access(const XrdSecEntity *Entity, const char *path, const Access_Operation oper, std::string &eInfo, XrdOucEnv *Env=0)
virtual int Audit(const int accok, const XrdSecEntity *Entity, const char *path, const Access_Operation oper, XrdOucEnv *Env=0)=0
virtual ~XrdAccAuthorize()
Destructor.
XrdAccAuthorize()
Constructor.
virtual XrdAccPrivs Access(const XrdSecEntity *Entity, const char *path, const Access_Operation oper, XrdOucEnv *Env=0)=0
XrdOucEnv * envP
Definition: XrdPss.cc:110