| 76 | } |
| 77 | |
| 78 | Status CheckProfileAccess(const string& user, const string& effective_user, |
| 79 | bool has_access) { |
| 80 | if (user.empty() || (user == effective_user && has_access)) return Status::OK(); |
| 81 | stringstream ss; |
| 82 | ss << "User " << user << " is not authorized to access the runtime profile or " |
| 83 | << "execution summary."; |
| 84 | return Status(ss.str()); |
| 85 | } |
| 86 | |
| 87 | // Replaces _HOST with the hostname if it occurs in the principal string. |
| 88 | Status ReplacePrincipalHostFormat(string* out_principal) { |
no test coverage detected