Merge branch 'develop' into feature/api-v1
# Conflicts: # app/Contracts/Repository/RepositoryInterface.php # app/Repositories/Eloquent/EloquentRepository.php # app/Services/Nodes/NodeUpdateService.php # tests/Unit/Services/Nodes/NodeUpdateServiceTest.php
This commit is contained in:
commit
800e2df6b2
187 changed files with 1878 additions and 3143 deletions
|
@ -27,12 +27,13 @@ namespace Pterodactyl\Models;
|
|||
use Sofa\Eloquence\Eloquence;
|
||||
use Sofa\Eloquence\Validable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Znck\Eloquent\Traits\BelongsToThrough;
|
||||
use Sofa\Eloquence\Contracts\CleansAttributes;
|
||||
use Sofa\Eloquence\Contracts\Validable as ValidableContract;
|
||||
|
||||
class DaemonKey extends Model implements CleansAttributes, ValidableContract
|
||||
{
|
||||
use Eloquence, Validable;
|
||||
use BelongsToThrough, Eloquence, Validable;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
@ -91,6 +92,17 @@ class DaemonKey extends Model implements CleansAttributes, ValidableContract
|
|||
return $this->belongsTo(Server::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the node relation.
|
||||
*
|
||||
* @return \Znck\Eloquent\Relations\BelongsToThrough
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function node()
|
||||
{
|
||||
return $this->belongsToThrough(Node::class, Server::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the user relation.
|
||||
*
|
||||
|
|
|
@ -119,13 +119,13 @@ class Server extends Model implements CleansAttributes, ValidableContract
|
|||
* @var array
|
||||
*/
|
||||
protected $searchableColumns = [
|
||||
'name' => 10,
|
||||
'uuidShort' => 9,
|
||||
'uuid' => 8,
|
||||
'pack.name' => 7,
|
||||
'user.email' => 6,
|
||||
'user.username' => 6,
|
||||
'node.name' => 2,
|
||||
'name' => 50,
|
||||
'uuidShort' => 10,
|
||||
'uuid' => 10,
|
||||
'pack.name' => 5,
|
||||
'user.email' => 20,
|
||||
'user.username' => 20,
|
||||
'node.name' => 10,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,6 +32,11 @@ class User extends Model implements
|
|||
const USER_LEVEL_USER = 0;
|
||||
const USER_LEVEL_ADMIN = 1;
|
||||
|
||||
const FILTER_LEVEL_ALL = 0;
|
||||
const FILTER_LEVEL_OWNER = 1;
|
||||
const FILTER_LEVEL_ADMIN = 2;
|
||||
const FILTER_LEVEL_SUBUSER = 3;
|
||||
|
||||
/**
|
||||
* Level of servers to display when using access() on a user.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue