mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
088ea287c5
* feat: initial commit for feature management * style: fix StyleCI findings * fix(api): prohibit features of nonnull scope from API & fix(admin): wrong translate key * style: fix Static Analysis error
20 lines
383 B
PHP
20 lines
383 B
PHP
<?php
|
|
|
|
namespace App\Features;
|
|
|
|
use App\Enums\Auth\SpecialPermission;
|
|
use App\Models\Auth\User;
|
|
use Laravel\Pennant\Feature;
|
|
|
|
class AllowAudioStreams
|
|
{
|
|
public function resolve(?User $user): bool
|
|
{
|
|
if (! empty($user?->can(SpecialPermission::BYPASS_FEATURE_FLAGS))) {
|
|
return true;
|
|
}
|
|
|
|
return Feature::for(null)->value(static::class);
|
|
}
|
|
}
|