-
Notifications
You must be signed in to change notification settings - Fork 2k
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
UI: add ACL-checking to turn off exec button #7919
Conversation
This is barely different from the job ability and I think it’s worth extracting an abstract base class.
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.
This looks great. I completely approve of refactoring behavior into an abstract class. I was close to doing it when I wrote the client ability 😅.
Some manner of further reducing the boilerplate to just a function call and a string like you suggest does sound appealing. I wouldn't be opposed to seeing that happen now, but I'm also okay with this subsystem of the UI maturing over time.
It’s my hope that it’ll become easier to use inheritance to accomplish that look-for-this-capability calculation once we have “native” classes 🤞😀 |
# Conflicts: # ui/tests/pages/jobs/detail.js
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This closes #7453. It’s set to merge into #7836 as it builds on its test infrastructure.
Though this doesn’t fully meet the three-repetitions abstraction guideline because client permissions are handled so differently from allocation and job permissions, extracting the pseudo-abstract ability base class seemed worth it to me because of how much shared functionality there was between the allocation and job abilities, and the client ability makes use of some of it too.
I stopped short of also extracting a computed property that searches for the requisite fine-grained string (
alloc-exec
in this case), despite the sole difference being the string being searched for. I think this would be easier in a true Javascript class context because the subclasses would be able to call a function to generate computed property to search for the particular string. If generalising this seems desirable, I could do it instead with a computed property that’s extracted into its own file.