mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 14:23:44 +02:00
Fix authorization checking for subusers
This commit is contained in:
@@ -37,9 +37,7 @@ use Pterodactyl\Notifications\SendPasswordReset as ResetPasswordNotification;
|
||||
*
|
||||
* @property string $name
|
||||
* @property \Pterodactyl\Models\ApiKey[]|\Illuminate\Database\Eloquent\Collection $apiKeys
|
||||
* @property \Pterodactyl\Models\Permission[]|\Illuminate\Database\Eloquent\Collection $permissions
|
||||
* @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers
|
||||
* @property \Pterodactyl\Models\Subuser[]|\Illuminate\Database\Eloquent\Collection $subuserOf
|
||||
* @property \Pterodactyl\Models\DaemonKey[]|\Illuminate\Database\Eloquent\Collection $keys
|
||||
*/
|
||||
class User extends Validable implements
|
||||
@@ -220,16 +218,6 @@ class User extends Validable implements
|
||||
return trim($this->name_first . ' ' . $this->name_last);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all permissions that a user has.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
*/
|
||||
public function permissions()
|
||||
{
|
||||
return $this->hasManyThrough(Permission::class, Subuser::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all servers that a user owns.
|
||||
*
|
||||
@@ -240,16 +228,6 @@ class User extends Validable implements
|
||||
return $this->hasMany(Server::class, 'owner_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all servers that user is listed as a subuser of directly.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function subuserOf()
|
||||
{
|
||||
return $this->hasMany(Subuser::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all of the daemon keys that a user belongs to.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user