Remove api permissions table

This commit is contained in:
Dane Everitt 2018-01-14 12:05:18 -06:00
parent b566630311
commit 7aa540b895
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
12 changed files with 17 additions and 449 deletions

View file

@ -1,58 +0,0 @@
<?php
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
*
* This software is licensed under the terms of the MIT license.
* https://opensource.org/licenses/MIT
*/
namespace Pterodactyl\Services\Api;
use Pterodactyl\Contracts\Repository\ApiPermissionRepositoryInterface;
class PermissionService
{
/**
* @var \Pterodactyl\Contracts\Repository\ApiPermissionRepositoryInterface
*/
protected $repository;
/**
* ApiPermissionService constructor.
*
* @param \Pterodactyl\Contracts\Repository\ApiPermissionRepositoryInterface $repository
*/
public function __construct(ApiPermissionRepositoryInterface $repository)
{
$this->repository = $repository;
}
/**
* Store a permission key in the database.
*
* @param string $key
* @param string $permission
* @return bool
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
public function create($key, $permission)
{
// @todo handle an array of permissions to do a mass assignment?
return $this->repository->withoutFreshModel()->create([
'key_id' => $key,
'permission' => $permission,
]);
}
/**
* Return all of the permissions available for an API Key.
*
* @return array
*/
public function getPermissions()
{
return $this->repository->getModel()::CONST_PERMISSIONS;
}
}