MCPcopy Create free account
hub / github.com/apache/mesos / authorizeGetQuota

Method authorizeGetQuota

src/master/quota_handler.cpp:1071–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1069
1070
1071Future<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
1096Future<bool> Master::QuotaHandler::authorizeUpdateQuota(

Callers

nothing calls this directly

Calls 7

createSubjectFunction · 0.85
CopyFromMethod · 0.80
stringifyFunction · 0.50
isNoneMethod · 0.45
isSomeMethod · 0.45
getMethod · 0.45
authorizedMethod · 0.45

Tested by

no test coverage detected