Update users & locations to use new permissions format
This commit is contained in:
parent
a31e5875dc
commit
d644a53951
15 changed files with 355 additions and 72 deletions
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Http\Controllers\API\Admin\Locations;
|
||||
|
||||
use Pterodactyl\Models\Location;
|
||||
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
||||
use Pterodactyl\Http\Requests\API\Admin\ApiAdminRequest;
|
||||
|
||||
class StoreLocationRequest extends ApiAdminRequest
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $resource = AdminAcl::RESOURCE_LOCATIONS;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $permission = AdminAcl::WRITE;
|
||||
|
||||
/**
|
||||
* Rules to validate the request aganist.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return collect(Location::getCreateRules())->only([
|
||||
'long',
|
||||
'short',
|
||||
])->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename fields to be more clear in error messages.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function attributes()
|
||||
{
|
||||
return [
|
||||
'long' => 'Location Description',
|
||||
'short' => 'Location Identifier',
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue