Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ $levels = $user->getAuthorisedViewLevels();
$canView = in_array($item->access, $levels);
```

It's important to note that the `core.edit.own` permission does not inherently check if the user created the item. This can be accomplished by combining checking this permission with the item's created_by value, such as with `$user->authorise('core.edit.own', 'com_example.item.' . $this->item->id) && $this->item->created_by == $user->id`

However, note that Super Users should be able to see all items, regardless of the Access Level, so generally there's another check:
```php
if ($user->authorise('core.admin')) {
Expand All @@ -66,4 +68,4 @@ You can find if a user is logged in or not by checking the `guest` property of t
if ($user->guest) {
throw new \Exception(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}
```
```