Revision bfaabf35 include/AuthManager.h

View differences:

include/AuthManager.h
276 276
     */
277 277
    enum Operation
278 278
    {
279
        CREATE,     /** Authorization to create an object   */
280
        DELETE,     /** Authorization to delete an object   */
281
        USE,        /** Authorization to use an object      */
282
        MANAGE,     /** Authorization to manage an object   */
283
        INFO,       /** Authorization to view an object     */
284
        INFO_POOL,  /** Authorization to view any object in the pool */
285
        INFO_POOL_MINE, /** Authorization to view user and/or group objects */ 
286
        INSTANTIATE, /** Authorization to instantiate a VM from a TEMPLATE  */
287
        CHOWN /** Authorization to change ownership of an object */
279
        CREATE        = 0x1LL,  /**< Auth. to create an object                */
280
        DELETE        = 0x2LL,  /**< Auth. to delete an object                */
281
        USE           = 0x4LL,  /**< Auth. to use an object                   */
282
        MANAGE        = 0x8LL,  /**< Auth. to manage an object                */
283
        INFO          = 0x10LL, /**< Auth. to view an object                  */
284
        INFO_POOL     = 0x20LL, /**< Auth. to view any object in the pool     */
285
        INFO_POOL_MINE= 0x40LL, /**< Auth. to view user and/or group objects  */
286
        INSTANTIATE   = 0x80LL, /**< Auth. to instantiate a VM from a TEMPLATE*/
287
        CHOWN         = 0x100LL /**< Auth. to change ownership of an object   */
288
    };
289

  
290
    static string Operation_to_str(Operation op)
291
    {
292
        switch (op)
293
        {
294
            case CREATE:            return "CREATE";
295
            case DELETE:            return "DELETE";
296
            case USE:               return "USE";
297
            case MANAGE:            return "MANAGE";
298
            case INFO:              return "INFO";
299
            case INFO_POOL:         return "INFO_POOL";
300
            case INFO_POOL_MINE:    return "INFO_POOL_MINE";
301
            case INSTANTIATE:       return "INSTANTIATE";
302
            case CHOWN:             return "CHOWN";
303
            default:                return "";
304
        }
288 305
    };
289 306

  
290 307
    /**
......
292 309
     */
293 310
    enum Object
294 311
    {
295
        VM,
296
        HOST,
297
        NET,
298
        IMAGE,
299
        USER,
300
        TEMPLATE,
301
        GROUP
312
        VM         = 0x1000000000LL,
313
        HOST       = 0x2000000000LL,
314
        NET        = 0x4000000000LL,
315
        IMAGE      = 0x8000000000LL,
316
        USER       = 0x10000000000LL,
317
        TEMPLATE   = 0x20000000000LL,
318
        GROUP      = 0x40000000000LL,
319
        ACL        = 0x80000000000LL
320
    };
321

  
322
    static string Object_to_str(Object ob)
323
    {
324
        switch (ob)
325
        {
326
            case VM:       return "VM" ; break;
327
            case HOST:     return "HOST" ; break;
328
            case NET:      return "NET" ; break;
329
            case IMAGE:    return "IMAGE" ; break;
330
            case USER:     return "USER" ; break;
331
            case TEMPLATE: return "TEMPLATE" ; break;
332
            case GROUP:    return "GROUP" ; break;
333
            default:       return "";
334
        }
302 335
    };
303 336

  
304 337
    /**

Also available in: Unified diff