-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Cleanup of canDelete, canEdit and canEditState in Component Models #13500
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
Changes from 14 commits
ce3a621
ebe5379
c5eedbc
97c1d9a
76087c1
99cc8a4
c3bebdf
7ebd7f4
6ac70f3
638a436
893e81d
8626190
31de08e
1491c37
b865fbb
b702f80
1d872e4
fed55e1
ff09ef4
f29ab48
350ec12
fa64188
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 |
|---|---|---|
|
|
@@ -94,25 +94,19 @@ protected function canDelete($record) | |
| { | ||
| $user = JFactory::getUser(); | ||
|
|
||
| if (!empty($record->id)) | ||
| if (empty($record->id) || $record->published != -2) | ||
| { | ||
| // Only delete trashed items | ||
| if ($record->published != -2) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| $menuTypeId = 0; | ||
| return false; | ||
| } | ||
|
|
||
| if (!empty($record->menutype)) | ||
| { | ||
| $menuTypeId = $this->getMenuTypeId($record->menutype); | ||
| } | ||
| $menuTypeId = 0; | ||
|
|
||
| return $user->authorise('core.delete', 'com_menus.menu.' . (int) $menuTypeId); | ||
| if (!empty($record->menutype)) | ||
| { | ||
| $menuTypeId = $this->getMenuTypeId($record->menutype); | ||
| } | ||
|
|
||
| return false; | ||
| return $user->authorise('core.delete', 'com_menus.menu.' . (int) $menuTypeId); | ||
|
||
| } | ||
|
|
||
| /** | ||
|
|
||
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.
Delete line 43 and change to:
return JFactory::getUser()->authorise('core.delete', 'com_banners.category.' . (int) $record->catid);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.
Nice spot!