This commit is contained in:
Mathieu Lagace
2019-09-30 17:06:31 -04:00
parent d1ce6ba6da
commit 0166c48daa
38 changed files with 618 additions and 201 deletions

View File

@@ -32,6 +32,11 @@ class User extends Authenticatable
return $this->belongsTo('App\Rank');
}
public function job()
{
return $this->belongsTo('App\Job');
}
public function logs()
{
return $this->hasMany(Log::class);
@@ -287,7 +292,14 @@ class User extends Authenticatable
public function permission($perm)
{
return $this->rank->permission($perm);
if ($this->job->permission($perm) == 0)
{
return $this->rank->permission($perm);
}
else
{
return $this->job->permission($perm);
}
}
public function p($perm)