| 1069 | |
| 1070 | |
| 1071 | Future<bool> Master::QuotaHandler::authorizeGetQuota( |
| 1072 | const Option<Principal>& principal, const string& role) const |
| 1073 | { |
| 1074 | if (master->authorizer.isNone()) { |
| 1075 | return true; |
| 1076 | } |
| 1077 | |
| 1078 | LOG(INFO) << "Authorizing principal '" |
| 1079 | << (principal.isSome() ? stringify(principal.get()) : "ANY") |
| 1080 | << "' to get quota for role '" << role << "'"; |
| 1081 | |
| 1082 | authorization::Request request; |
| 1083 | request.set_action(authorization::GET_QUOTA); |
| 1084 | |
| 1085 | Option<authorization::Subject> subject = createSubject(principal); |
| 1086 | if (subject.isSome()) { |
| 1087 | request.mutable_subject()->CopyFrom(subject.get()); |
| 1088 | } |
| 1089 | |
| 1090 | request.mutable_object()->set_value(role); |
| 1091 | |
| 1092 | return master->authorizer.get()->authorized(request); |
| 1093 | } |
| 1094 | |
| 1095 | |
| 1096 | Future<bool> Master::QuotaHandler::authorizeUpdateQuota( |
nothing calls this directly
no test coverage detected