Add support for allowing subusers to access SFTP. (#918)
This commit is contained in:
parent
f61a5fa0cb
commit
d8be167a9c
10 changed files with 64 additions and 70 deletions
|
@ -42,12 +42,11 @@ class PermissionCreationServiceTest extends TestCase
|
|||
*/
|
||||
public function testPermissionsAreAssignedCorrectly()
|
||||
{
|
||||
$permissions = ['reset-sftp', 'view-sftp'];
|
||||
$permissions = ['access-sftp'];
|
||||
|
||||
$this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf()
|
||||
->shouldReceive('insert')->with([
|
||||
['subuser_id' => 1, 'permission' => 'reset-sftp'],
|
||||
['subuser_id' => 1, 'permission' => 'view-sftp'],
|
||||
['subuser_id' => 1, 'permission' => 'access-sftp'],
|
||||
])->once()->andReturn(true);
|
||||
|
||||
$this->service->handle(1, $permissions);
|
||||
|
|
|
@ -121,7 +121,7 @@ class SubuserCreationServiceTest extends TestCase
|
|||
*/
|
||||
public function testExistingUserCanBeAddedAsASubuser()
|
||||
{
|
||||
$permissions = ['view-sftp', 'reset-sftp'];
|
||||
$permissions = ['access-sftp'];
|
||||
$server = factory(Server::class)->make();
|
||||
$user = factory(User::class)->make();
|
||||
$subuser = factory(Subuser::class)->make(['user_id' => $user->id, 'server_id' => $server->id]);
|
||||
|
|
Reference in a new issue