This commit is contained in:
Andras Bacsai
2023-06-08 11:43:14 +02:00
parent 9767ca47ff
commit 127d42d873
12 changed files with 34 additions and 19 deletions

View File

@@ -35,6 +35,11 @@ class User extends Authenticatable
});
}
public function isAdmin()
{
ray(session('currentTeam'));
return session('currentTeam');
}
public function isInstanceAdmin()
{
$found_root_team = auth()->user()->teams->filter(function ($team) {
if ($team->id == 0) {
@@ -49,10 +54,10 @@ class User extends Authenticatable
return $this->belongsToMany(Team::class);
}
public function currentTeam()
{
return $this->belongsTo(Team::class);
}
// public function currentTeam()
// {
// return $this->belongsTo(Team::class);
// }
public function otherTeams()
{