Initial Commit of Files
PufferPanel v0.9 (Laravel) is now Pterodactyl 1.0
This commit is contained in:
commit
1489f7a694
154 changed files with 10159 additions and 0 deletions
30
app/Models/APIPermission.php
Normal file
30
app/Models/APIPermission.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
use Debugbar;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class APIPermission extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'api_permissions';
|
||||
|
||||
/**
|
||||
* Checks if an API key has a specific permission.
|
||||
*
|
||||
* @param int $id
|
||||
* @param string $permission
|
||||
* @return boolean
|
||||
*/
|
||||
public static function check($id, $permission)
|
||||
{
|
||||
return self::where('key_id', $id)->where('permission', $permission)->exists();
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue