mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-09 01:43:51 +02:00
Push basis of new API key policy
Will need to revisit this another day when I’m fresh to figure out the best method to do this.
This commit is contained in:
@@ -60,9 +60,17 @@ class ServerController extends Controller
|
||||
public function view(Request $request, $id)
|
||||
{
|
||||
$server = Server::findOrFail($id);
|
||||
|
||||
$fractal = Fractal::create()->item($server);
|
||||
|
||||
// dd($request->user()->can('view-node', $request->apiKey()));
|
||||
|
||||
// Have the api key model return a list of includes that would be allowed
|
||||
// given the permissions they have aleady been granted?
|
||||
//
|
||||
// If someone has 'view-node' they would then be able to use ->parseIncludes(['*.node.*']);
|
||||
// How that logic will work is beyond me currently, but should keep things
|
||||
// fairly clean?
|
||||
|
||||
if ($request->input('include')) {
|
||||
$fractal->parseIncludes(explode(',', $request->input('include')));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user