Skip to content

Commit

Permalink
make route strategy respect the full user
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed May 23, 2017
1 parent 4c84232 commit 26cd8fd
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions pkg/route/registry/route/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@ func (s routeStrategy) allocateHost(ctx apirequest.Context, route *api.Route) fi
}
res, err := s.sarClient.CreateSubjectAccessReview(
ctx,
&authorizationapi.SubjectAccessReview{
User: user.GetName(),
Action: authorizationapi.Action{
Verb: "create",
Group: api.GroupName,
Resource: "routes/custom-host",
authorizationapi.AddUserToSAR(
user,
&authorizationapi.SubjectAccessReview{
Action: authorizationapi.Action{
Verb: "create",
Group: api.GroupName,
Resource: "routes/custom-host",
},
},
},
),
)
if err != nil {
return field.ErrorList{field.InternalError(field.NewPath("spec", "host"), err)}
Expand Down Expand Up @@ -169,14 +171,16 @@ func (s routeStrategy) validateHostUpdate(ctx apirequest.Context, route, older *
}
res, err := s.sarClient.CreateSubjectAccessReview(
ctx,
&authorizationapi.SubjectAccessReview{
User: user.GetName(),
Action: authorizationapi.Action{
Verb: "update",
Group: "route.openshift.io",
Resource: "routes/custom-host",
authorizationapi.AddUserToSAR(
user,
&authorizationapi.SubjectAccessReview{
Action: authorizationapi.Action{
Verb: "update",
Group: "route.openshift.io",
Resource: "routes/custom-host",
},
},
},
),
)
if err != nil {
return field.ErrorList{field.InternalError(field.NewPath("spec", "host"), err)}
Expand Down

0 comments on commit 26cd8fd

Please sign in to comment.