forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHasUserLevels.php
More file actions
47 lines (40 loc) · 858 Bytes
/
HasUserLevels.php
File metadata and controls
47 lines (40 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace Pterodactyl\Traits\Services;
use Pterodactyl\Models\User;
trait HasUserLevels
{
/**
* @var int
*/
private $userLevel = User::USER_LEVEL_USER;
/**
* Set the access level for running this function.
*
* @param int $level
* @return $this
*/
public function setUserLevel(int $level)
{
$this->userLevel = $level;
return $this;
}
/**
* Determine which level this function is running at.
*
* @return int
*/
public function getUserLevel(): int
{
return $this->userLevel;
}
/**
* Determine if the current user level is set to a specific level.
*
* @param int $level
* @return bool
*/
public function isUserLevel(int $level): bool
{
return $this->getUserLevel() === $level;
}
}