mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 18:18:29 +00:00
middleware should allow, not deny
This commit is contained in:
1 parent
d4d63ff273
commit
6520235667
15 files changed
+149
-211
No files matched your search
@@ -29,7 +29,7 @@ class ApplicationsController extends Controller
|
||||
$application->makeHidden([
|
||||
'id',
|
||||
]);
|
||||
if ($token->can('view:sensitive')) {
|
||||
if ($token->can('read:sensitive')) {
|
||||
return serializeApiResponse($application);
|
||||
}
|
||||
$application->makeHidden([
|
||||
|
||||
@@ -24,7 +24,7 @@ class DatabasesController extends Controller
|
||||
'id',
|
||||
'laravel_through_key',
|
||||
]);
|
||||
if ($token->can('view:sensitive')) {
|
||||
if ($token->can('read:sensitive')) {
|
||||
return serializeApiResponse($database);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class DeployController extends Controller
|
||||
private function removeSensitiveData($deployment)
|
||||
{
|
||||
$token = auth()->user()->currentAccessToken();
|
||||
if ($token->can('view:sensitive')) {
|
||||
if ($token->can('read:sensitive')) {
|
||||
return serializeApiResponse($deployment);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class SecurityController extends Controller
|
||||
private function removeSensitiveData($team)
|
||||
{
|
||||
$token = auth()->user()->currentAccessToken();
|
||||
if ($token->can('view:sensitive')) {
|
||||
if ($token->can('read:sensitive')) {
|
||||
return serializeApiResponse($team);
|
||||
}
|
||||
$team->makeHidden([
|
||||
|
||||
@@ -20,7 +20,7 @@ class ServersController extends Controller
|
||||
private function removeSensitiveDataFromSettings($settings)
|
||||
{
|
||||
$token = auth()->user()->currentAccessToken();
|
||||
if ($token->can('view:sensitive')) {
|
||||
if ($token->can('read:sensitive')) {
|
||||
return serializeApiResponse($settings);
|
||||
}
|
||||
$settings = $settings->makeHidden([
|
||||
@@ -36,7 +36,7 @@ class ServersController extends Controller
|
||||
$server->makeHidden([
|
||||
'id',
|
||||
]);
|
||||
if ($token->can('view:sensitive')) {
|
||||
if ($token->can('read:sensitive')) {
|
||||
return serializeApiResponse($server);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class ServicesController extends Controller
|
||||
$service->makeHidden([
|
||||
'id',
|
||||
]);
|
||||
if ($token->can('view:sensitive')) {
|
||||
if ($token->can('read:sensitive')) {
|
||||
return serializeApiResponse($service);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class TeamController extends Controller
|
||||
'custom_server_limit',
|
||||
'pivot',
|
||||
]);
|
||||
if ($token->can('view:sensitive')) {
|
||||
if ($token->can('read:sensitive')) {
|
||||
return serializeApiResponse($team);
|
||||
}
|
||||
$team->makeHidden([
|
||||
|
||||
Reference in new issue
Block a user