1
0
Fork 0

fixed bug for any hasAnyAccess for super admin

main
A1Gard 1 year ago
parent a44c2f57b9
commit e439d883ee

@ -101,6 +101,9 @@ class User extends Authenticatable
return $this->hasMany(Access::class);
}
public function hasAnyAccess($name){
if ($this->hasRole('super-admin')){
return true;
}
return $this->accesses()->where('route','LIKE','%.'.$name.'.%')->count() > 0;
}

Loading…
Cancel
Save