[5.2] Fix Permissions for Manually Running Scheduled Tasks#36719
[5.2] Fix Permissions for Manually Running Scheduled Tasks#36719Hackwar merged 16 commits intojoomla:5.2-devfrom
Conversation
- Explicitly disables the "run task" button on insufficient authorization. - Adds tooltip to give context on disabling.
…run-task-btn-on-no-auth-36677'
|
How can it make sense for a user to be able to create a new task and setup lazy loading etc but not be able to run the task directly |
Definitely, now that I think of it the creator should be able to run them manually as a default. I'll work on enabling that behavior before opening this PR. |
|
Possibly need a new permission for that "Edit own" |
Task creators should now be able to run them even if they do not have the `core.testrun` permission. The current permission checks should be reviewed.
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public static function isAuthorizedToRun(object $taskRecord, User $user): bool |
There was a problem hiding this comment.
@brianteeman what do you think about this check?
We need this field in the authorization check. Begs the question, should we just get all fields?
|
This pull request has automatically rebased to 4.2-dev. |
|
This pull request has been automatically rebased to 4.3-dev. |
|
This pull request has been automatically rebased to 4.4-dev. |
|
This pull request has been automatically rebased to 5.2-dev. |
|
I have tested this item ✅ successfully on eb813f6 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36719. |
|
I have tested this item 🔴 unsuccessfully on eb813f6 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36719. |
|
@dautrich Of course you shall be able to run your own tasks as user in the administrator group. And as administrator you shall also be able to create tasks. But the ones created by the super user are disabled. To me it seems it is workings as intended. |
|
P.S. Without the PR, one error is that you can not run tasks which you have created when you are an administrator. This is also fixed by this PR, that’s why you can create tasks and run them as administrator. |
|
Then the testing instructions seem to be misleading. It says: "Create a new task with an admin (not superuser) account." And that's what I did. |
|
Hmm I see the testing instructions are not precise. |
|
@dautrich I've updated the testing instructions. Thanks for the hint. |
|
P.S. I've updated again testing instructions and added a test for trashed tasks. |
|
I have tested this item ✅ successfully on eb813f6 (thanks for the updated testing instructions Richard!) ( Cool PR btw, thanks to all that made it possible ). This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36719. |
|
I have tested this item ✅ successfully on eb813f6 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36719. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36719. |
|
Thanks for testing. |
|
Thank you! |
joomla/joomla-cms#44658 + joomla/joomla-cms#44712 - (только для др. пакетов) joomla/joomla-cms#39878 + joomla/joomla-cms#38536 + joomla/joomla-cms#36719 + joomla/joomla-cms#44753 + joomla/joomla-cms#44709 + joomla/joomla-cms#44793 - (только для en-GB)


Pull Request for Issue #36677.
Summary of Changes
Testing Instructions
Actual result BEFORE applying this Pull Request
As administrator (not superuser), there is no indication that the user is not authorized to run the task. The button is usable.
In all cases there is an error message.
Only a super user can run tasks.
Expected result AFTER applying this Pull Request
As administrator (not superuser):
As super user buttons of all tasks are enabled, and you can run these tasks.
When a task is trashed, the button is disabled, and a tool tip shows the reason.
Documentation Changes Required
N/A