-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
edit ember-can to add additional attribute for namespace #10893
Changes from all commits
d92261e
b09559e
3e07db8
18ddb2d
65fd437
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
ui: Fixes bug where UI was not detecting namespace-specific capabilities. | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,8 @@ | |
</div> | ||
{{#if (media "isMobile")}} | ||
<div class="toolbar-item is-right-aligned"> | ||
{{#if (can "run job")}} | ||
<LinkTo @route="jobs.run" data-test-run-job class="button is-primary">Run Job</LinkTo> | ||
{{#if (can "run job" namespace=this.qpNamespace)}} | ||
<LinkTo @route="jobs.run" @query={{hash namespace=this.qpNamespace}} data-test-run-job class="button is-primary">Run Job</LinkTo> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't comment on the ability file, but I think we need to add an extra check to allow running jobs if the wildcard namespace ( For example, a policy like this: namespace "dev" {
policy = "write"
} Should allow the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Buck disagreed with that, I think. Which is why we had this issue: #10545. Buck's opinions were that routes and views shouldn't be accessible if you don't have permissions. You shouldn't think you can go somewhere that you actually can't and then fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But in the example that I gave you do have permission to run jobs in the |
||
{{else}} | ||
<button | ||
data-test-run-job | ||
|
@@ -66,8 +66,8 @@ | |
</div> | ||
{{#if (not (media "isMobile"))}} | ||
<div class="toolbar-item is-right-aligned"> | ||
{{#if (can "run job")}} | ||
<LinkTo @route="jobs.run" data-test-run-job class="button is-primary">Run Job</LinkTo> | ||
{{#if (can "run job" namespace=this.qpNamespace)}} | ||
<LinkTo @route="jobs.run" @query={{hash namespace=this.qpNamespace}} data-test-run-job class="button is-primary">Run Job</LinkTo> | ||
{{else}} | ||
<button | ||
data-test-run-job | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this being used? The template is accessing the namespace from the task group directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, its used in line 28 below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks! I missed that.
Follow-up question: should this be used in the view then? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that means that we can clean things up. Great callout.