[
https://issues.apache.org/jira/browse/MESOS-7489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gavin updated MESOS-7489:
-------------------------
Comment: was deleted
(was: www.rtat.net)
> Reduce code duplication when requesting an ObjectApprover
> ---------------------------------------------------------
>
> Key: MESOS-7489
> URL: https://issues.apache.org/jira/browse/MESOS-7489
> Project: Mesos
> Issue Type: Improvement
> Components: agent, master, security
> Reporter: Alexander Rojas
> Priority: Minor
> Labels: code-cleanup, mesosphere, tech-debt
>
> Every time the code needs to use an authorizer, the following snippet is used:
> {code}
> Future<Owned<ObjectApprover>> somethingApprover;
> if (master->authorizer.isSome()) {
> Option<authorization::Subject> subject = createSubject(principal);
> somethingApprover = master->authorizer.get()->getObjectApprover(
> subject, authorization::VIEW_FRAMEWORK);
> } else {
> somethingApprover = Owned<ObjectApprover>(new AcceptingObjectApprover());
> }
> return somethingApprover.then(…)
> {code}
> This can be easily replace my a method:
> {code}
> Future<ObjectApprover> Master::approver(
> const Option<authorization::Subject> &subject,
> const authorization::Action &action)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)