mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-14 09:15:01 +00:00
- Restrictions for team folders
This commit is contained in:
@@ -3,6 +3,7 @@ namespace App\Limitations\Engines;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use App\Limitations\LimitationEngine;
|
||||
use Domain\Teams\Actions\CheckMaxTeamMembersLimitAction;
|
||||
|
||||
class DefaultLimitationEngine implements LimitationEngine
|
||||
{
|
||||
@@ -20,8 +21,7 @@ class DefaultLimitationEngine implements LimitationEngine
|
||||
);
|
||||
|
||||
// 2. Check if storage usage exceed predefined capacity
|
||||
return ! ($usedPercentage >= 100)
|
||||
;
|
||||
return ! ($usedPercentage >= 100);
|
||||
}
|
||||
|
||||
public function canDownload(User $user): bool
|
||||
@@ -33,4 +33,14 @@ class DefaultLimitationEngine implements LimitationEngine
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function canCreateTeamFolder(User $user): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function canInviteTeamMembers(User $user, array $newInvites): bool
|
||||
{
|
||||
return resolve(CheckMaxTeamMembersLimitAction::class)($user, $newInvites);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace App\Limitations\Engines;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use App\Limitations\LimitationEngine;
|
||||
use Domain\Teams\Actions\CheckMaxTeamMembersLimitAction;
|
||||
|
||||
class FixedBillingLimitationEngine implements LimitationEngine
|
||||
{
|
||||
@@ -27,4 +28,14 @@ class FixedBillingLimitationEngine implements LimitationEngine
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function canCreateTeamFolder(User $user): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function canInviteTeamMembers(User $user, array $newInvites): bool
|
||||
{
|
||||
return resolve(CheckMaxTeamMembersLimitAction::class)($user, $newInvites);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,15 @@ class MeteredBillingLimitationEngine implements LimitationEngine
|
||||
// Disable create folder when user has more than 3 failed payments
|
||||
return ! ($user->failedPayments()->count() >= 3);
|
||||
}
|
||||
|
||||
public function canCreateTeamFolder(User $user): bool
|
||||
{
|
||||
// Disable create folder when user has more than 3 failed payments
|
||||
return ! ($user->failedPayments()->count() >= 3);
|
||||
}
|
||||
|
||||
public function canInviteTeamMembers(User $user, array $newInvites): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,4 +10,8 @@ interface LimitationEngine
|
||||
public function canDownload(User $user): bool;
|
||||
|
||||
public function canCreateFolder(User $user): bool;
|
||||
|
||||
public function canCreateTeamFolder(User $user): bool;
|
||||
|
||||
public function canInviteTeamMembers(User $user, array $newInvites): bool;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user