Revision 01d932ad src/rm/RequestManagerPoolInfoFilter.cc

View differences:

src/rm/RequestManagerPoolInfoFilter.cc
66 66
            break;
67 67
    }
68 68

  
69
    //Authorize the operation
70
    if ( uid != 0 && (filter_flag == ALL || filter_flag >= 0) ) // uid == 0 means oneadmin
71
    {
72
        AuthRequest ar(uid);
73

  
74
        ar.add_auth(auth_object,
75
                    -1,
76
                    AuthRequest::INFO_POOL,
77
                    0,
78
                    false);
79

  
80
        if (UserPool::authorize(ar) == -1)
81
        {
82
            goto error_authorize;
83
        }
84
    }
85

  
69 86
    // Call the template pool dump
70 87
    rc = pool->dump(oss,where_string.str());
71 88

  
......
82 99
    failure_response(XML_RPC_API, "Incorrect filter_flag, must be >= -3.");
83 100
    return;
84 101

  
102
//TODO Get the object name from the AuthRequest Class
103
error_authorize:
104
    failure_response(AUTHORIZATION,
105
                     authorization_error("INFO","USER",uid,-1));
106
    return;
107

  
85 108
error_dump: //TBD Improve Error messages for DUMP
86 109
    oss.str();
87 110
    failure_response(INTERNAL,"Internal Error");

Also available in: Unified diff