Mejoras generales .w. se me olvida que agrego

This commit is contained in:
2021-07-20 00:36:50 -04:00
parent 19207b89f6
commit 7fa39a8b11
9 changed files with 88 additions and 18 deletions

View File

@@ -32,11 +32,15 @@ class Usuario extends Model {
}
public function isGlobalAdmin() {
return in_array('global_admin', $this->roles);
return $this->hasRole('global_admin');
}
public function isAdmin() {
return in_array('admin', $this->roles);
return $this->hasRole('admin');
}
public function hasRole($role) {
return in_array($role, $this->roles);
}
public function restaurantes() {