Add calls and API to get user's fleet, determined by rank #35
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use App\Facades\Utils;
|
||||
use App\Models\User;
|
||||
@@ -53,6 +54,18 @@ class UserService extends BaseService
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the subfleets this user is allowed access to,
|
||||
* based on their current rank
|
||||
* @param $user
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAllowableSubfleets($user)
|
||||
{
|
||||
$subfleets = $user->rank->subfleets();
|
||||
return $subfleets->with('aircraft')->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the user's state. PENDING to ACCEPTED, etc
|
||||
* Send out an email
|
||||
|
||||
Reference in New Issue
Block a user