mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 23:36:08 -06:00
fixed edit category probleb for admin roles
This commit is contained in:
parent
71a4743cf6
commit
8039771dea
@ -72,11 +72,15 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
|
||||
public function userAdv()
|
||||
{
|
||||
|
||||
if (Auth::user()->hasRole('admin')) {
|
||||
return $this->getAdv();
|
||||
} else {
|
||||
return $this->getAdv()
|
||||
->where('advs_advs.created_by_id', Auth::id());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getAdvByCat($cat_id)
|
||||
{
|
||||
return $this->userAdv()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user