mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 10:16:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			36 lines
		
	
	
		
			848 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			848 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Pterodactyl\Services\Subusers;
 | 
						|
 | 
						|
use Pterodactyl\Models\Subuser;
 | 
						|
use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface;
 | 
						|
 | 
						|
class SubuserDeletionService
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * @var \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface
 | 
						|
     */
 | 
						|
    private $repository;
 | 
						|
 | 
						|
    /**
 | 
						|
     * SubuserDeletionService constructor.
 | 
						|
     *
 | 
						|
     * @param \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface $repository
 | 
						|
     */
 | 
						|
    public function __construct(
 | 
						|
        SubuserRepositoryInterface $repository
 | 
						|
    ) {
 | 
						|
        $this->repository = $repository;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Delete a subuser and their associated permissions from the Panel and Daemon.
 | 
						|
     *
 | 
						|
     * @param \Pterodactyl\Models\Subuser $subuser
 | 
						|
     */
 | 
						|
    public function handle(Subuser $subuser)
 | 
						|
    {
 | 
						|
        $this->repository->delete($subuser->id);
 | 
						|
    }
 | 
						|
}
 |