| 1094 | |
| 1095 | |
| 1096 | Future<bool> Master::QuotaHandler::authorizeUpdateQuota( |
| 1097 | const Option<Principal>& principal, |
| 1098 | const QuotaInfo& quotaInfo) const |
| 1099 | { |
| 1100 | if (master->authorizer.isNone()) { |
| 1101 | return true; |
| 1102 | } |
| 1103 | |
| 1104 | LOG(INFO) << "Authorizing principal '" |
| 1105 | << (principal.isSome() ? stringify(principal.get()) : "ANY") |
| 1106 | << "' to update quota for role '" << quotaInfo.role() << "'"; |
| 1107 | |
| 1108 | authorization::Request request; |
| 1109 | request.set_action(authorization::UPDATE_QUOTA); |
| 1110 | |
| 1111 | Option<authorization::Subject> subject = createSubject(principal); |
| 1112 | if (subject.isSome()) { |
| 1113 | request.mutable_subject()->CopyFrom(subject.get()); |
| 1114 | } |
| 1115 | |
| 1116 | request.mutable_object()->mutable_quota_info()->CopyFrom(quotaInfo); |
| 1117 | |
| 1118 | return master->authorizer.get()->authorized(request); |
| 1119 | } |
| 1120 | |
| 1121 | |
| 1122 | Future<bool> Master::QuotaHandler::authorizeUpdateQuotaConfig( |
nothing calls this directly
no test coverage detected