mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#4410 category edit bug
This commit is contained in:
parent
fcf23887a2
commit
7c0fc98abd
@ -141,7 +141,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
$query = $this::withTrashed();
|
||||
}
|
||||
|
||||
if ($id != null) {
|
||||
if ($id !== null) {
|
||||
if ($nullable_ad) {
|
||||
return $query->find($id);
|
||||
} else {
|
||||
@ -157,6 +157,10 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
|
||||
public function userAdv($nullable_ad = false, $checkRole = true)
|
||||
{
|
||||
if ($user = Auth::user() and $user->hasRole('admin') && $checkRole) {
|
||||
return $this->getAdv(null, $nullable_ad);
|
||||
}
|
||||
|
||||
return $this->getAdv(null, $nullable_ad)
|
||||
->where('advs_advs.created_by_id', Auth::id());
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user