mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 18:22:16 +01:00
Added time entry api endpoints; Increased phpstan level; renamed to solidtime
This commit is contained in:
@@ -13,9 +13,15 @@ use App\Models\Tag;
|
||||
use App\Models\Task;
|
||||
use App\Models\TimeEntry;
|
||||
use App\Models\User;
|
||||
use Dedoc\Scramble\Scramble;
|
||||
use Dedoc\Scramble\Support\Generator\OpenApi;
|
||||
use Dedoc\Scramble\Support\Generator\SecurityScheme;
|
||||
use Dedoc\Scramble\Support\Generator\SecuritySchemes\OAuthFlow;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@@ -55,5 +61,19 @@ class AppServiceProvider extends ServiceProvider
|
||||
Section::configureUsing(function (Section $section): void {
|
||||
$section->columns(1);
|
||||
}, null, true);
|
||||
|
||||
Scramble::extendOpenApi(function (OpenApi $openApi) {
|
||||
$openApi->secure(
|
||||
SecurityScheme::oauth2()
|
||||
->flow('authorizationCode', function (OAuthFlow $flow) {
|
||||
$flow
|
||||
->authorizationUrl('https://solidtime.test/oauth/authorize');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
if (config('app.force_https', false) || App::isProduction()) {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,14 @@ class JetstreamServiceProvider extends ServiceProvider
|
||||
'projects:create',
|
||||
'projects:update',
|
||||
'projects:delete',
|
||||
'time-entries:view:all',
|
||||
'time-entries:create:all',
|
||||
'time-entries:update:all',
|
||||
'time-entries:delete:all',
|
||||
'time-entries:view:own',
|
||||
'time-entries:create:own',
|
||||
'time-entries:update:own',
|
||||
'time-entries:delete:own',
|
||||
])->description('Administrator users can perform any action.');
|
||||
|
||||
Jetstream::role('manager', 'Manager', [
|
||||
@@ -63,13 +71,22 @@ class JetstreamServiceProvider extends ServiceProvider
|
||||
'projects:create',
|
||||
'projects:update',
|
||||
'projects:delete',
|
||||
'time-entries:view:all',
|
||||
'time-entries:create:all',
|
||||
'time-entries:update:all',
|
||||
'time-entries:delete:all',
|
||||
'time-entries:view:own',
|
||||
'time-entries:create:own',
|
||||
'time-entries:update:own',
|
||||
'time-entries:delete:own',
|
||||
])->description('Editor users have the ability to read, create, and update.');
|
||||
|
||||
Jetstream::role('employee', 'Employee', [
|
||||
'projects:view',
|
||||
'projects:create',
|
||||
'projects:update',
|
||||
'projects:delete',
|
||||
'time-entries:view:own',
|
||||
'time-entries:create:own',
|
||||
'time-entries:update:own',
|
||||
'time-entries:delete:own',
|
||||
])->description('Editor users have the ability to read, create, and update.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user