Changed permission check to requested namespace
Original code checked to see if the user had submit-job on the default namespace.
This commit is contained in:
parent
48e9e31cdf
commit
679e49448e
|
@ -1023,12 +1023,12 @@ func (j *Job) Plan(args *structs.JobPlanRequest, reply *structs.JobPlanResponse)
|
|||
if aclObj, err := j.srv.ResolveToken(args.AuthToken); err != nil {
|
||||
return err
|
||||
} else if aclObj != nil {
|
||||
if !aclObj.AllowNsOp(structs.DefaultNamespace, acl.NamespaceCapabilitySubmitJob) {
|
||||
if !aclObj.AllowNsOp(args.RequestNamespace(), acl.NamespaceCapabilitySubmitJob) {
|
||||
return structs.ErrPermissionDenied
|
||||
}
|
||||
// Check if override is set and we do not have permissions
|
||||
if args.PolicyOverride {
|
||||
if !aclObj.AllowNsOp(structs.DefaultNamespace, acl.NamespaceCapabilitySentinelOverride) {
|
||||
if !aclObj.AllowNsOp(args.RequestNamespace(), acl.NamespaceCapabilitySentinelOverride) {
|
||||
return structs.ErrPermissionDenied
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue