Add support for changing the server default allocation as a normal user

This commit is contained in:
Dane Everitt 2017-10-20 21:32:57 -05:00
parent 5a3428f0a0
commit d50ea18598
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
14 changed files with 308 additions and 68 deletions

View file

@ -64,6 +64,16 @@ class Allocation extends Model implements CleansAttributes, ValidableContract
'server_id' => 'nullable|exists:servers,id',
];
/**
* Return a hashid encoded string to represent the ID of the allocation.
*
* @return string
*/
public function getHashidAttribute()
{
return app()->make('hashids')->encode($this->id);
}
/**
* Accessor to automatically provide the IP alias if defined.
*

View file

@ -86,7 +86,8 @@ class Permission extends Model implements CleansAttributes, ValidableContract
'delete-subuser' => null,
],
'server' => [
'set-connection' => null,
'view-allocations' => null,
'edit-allocation' => null,
'view-startup' => null,
'edit-startup' => null,
],