mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Begin implementation of new daemon authentication scheme
This commit is contained in:
@@ -69,6 +69,26 @@ class SubuserRepository extends EloquentRepository implements SubuserRepositoryI
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getWithPermissionsUsingUserAndServer($user, $server)
|
||||
{
|
||||
Assert::integerish($user, 'First argument passed to getWithPermissionsUsingUserAndServer must be integer, received %s.');
|
||||
Assert::integerish($server, 'Second argument passed to getWithPermissionsUsingUserAndServer must be integer, received %s.');
|
||||
|
||||
$instance = $this->getBuilder()->with('permissions')->where([
|
||||
['user_id', '=', $user],
|
||||
['server_id', '=', $server],
|
||||
])->first();
|
||||
|
||||
if (is_null($instance)) {
|
||||
throw new RecordNotFoundException;
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -83,4 +103,24 @@ class SubuserRepository extends EloquentRepository implements SubuserRepositoryI
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getWithKey($user, $server)
|
||||
{
|
||||
Assert::integerish($user, 'First argument passed to getWithKey must be integer, received %s.');
|
||||
Assert::integerish($server, 'Second argument passed to getWithKey must be integer, received %s.');
|
||||
|
||||
$instance = $this->getBuilder()->with('key')->where([
|
||||
['user_id', '=', $user],
|
||||
['server_id', '=', $server],
|
||||
])->first();
|
||||
|
||||
if (is_null($instance)) {
|
||||
throw new RecordNotFoundException;
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user