Revision 0659115f src/rm/RequestManagerVirtualNetworkInfo.cc

View differences:

src/rm/RequestManagerVirtualNetworkInfo.cc
63 63
        goto error_vn_get;                     
64 64
    }
65 65
    
66
    //Authorize the operation
67
    if ( rc != 0 ) // rc == 0 means oneadmin
68
    {
69
        AuthRequest ar(rc);
70

  
71
        ar.add_auth(AuthRequest::NET,
72
                    nid,
73
                    AuthRequest::USE,
74
                    0,
75
                    vn->isPublic());
76

  
77
        if (UserPool::authorize(ar) == -1)
78
        {
79
            goto error_authorize;
80
        }
81
    }
82
    
83 66
    oss << *vn;
84 67
    
85 68
    vn->unlock();
......
104 87
    oss.str(get_error(method_name, "NET", nid));
105 88
    goto error_common;
106 89
    
107
error_authorize:
108
    vn->unlock();
109
    oss.str(authorization_error(method_name, "USE", "NET", rc, nid));
110
    goto error_common;
111

  
112 90
error_common:
113 91
    arrayData.push_back(xmlrpc_c::value_boolean(false)); // FAILURE
114 92
    arrayData.push_back(xmlrpc_c::value_string(oss.str()));

Also available in: Unified diff