{"record":{"id":"b6486892e1431992","repo":"coollabsio/coolify","slug":"only-team-administrators-and-owners-can-modify-ter","errorCode":null,"errorMessage":"Only team administrators and owners can modify terminal access.","messagePattern":"Only team administrators and owners can modify terminal access\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Livewire/Server/Security/TerminalAccess.php","lineNumber":41,"sourceCode":"        try {\n            $this->server = Server::ownedByCurrentTeam()->whereUuid($server_uuid)->firstOrFail();\n            $this->authorize('update', $this->server);\n            $this->parameters = get_route_parameters();\n            $this->syncData();\n\n        } catch (\\Throwable) {\n            return redirect()->route('server.index');\n        }\n    }\n\n    public function toggleTerminal($password, $selectedActions = [])\n    {\n        try {\n            $this->authorize('update', $this->server);\n\n            // Check if user is admin or owner\n            if (! auth()->user()->isAdmin()) {\n                throw new \\Exception('Only team administrators and owners can modify terminal access.');\n            }\n\n            // Verify password\n            if (! verifyPasswordConfirmation($password, $this)) {\n                return 'The provided password is incorrect.';\n            }\n\n            // Toggle the terminal setting\n            $this->server->settings->is_terminal_enabled = ! $this->server->settings->is_terminal_enabled;\n            $this->server->settings->save();\n\n            // Update the local property\n            $this->isTerminalEnabled = $this->server->settings->is_terminal_enabled;\n\n            $status = $this->isTerminalEnabled ? 'enabled' : 'disabled';\n            $this->dispatch('success', \"Terminal access has been {$status}.\");\n\n            return true;","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Livewire/Server/Security/TerminalAccess.php#L23-L59","documentation":"toggleTerminal() on the server Security > Terminal access screen passes authorize('update', $server) but additionally requires the acting user to be an admin or owner of the current team via auth()->user()->isAdmin() (Role::ADMIN rank or higher). Members can view the toggle but cannot flip is_terminal_enabled - enabling SSH terminal access on a server is restricted to team administrators and owners.","triggerScenarios":"A MEMBER-role user (or a demoted admin with a stale session) submitting the toggle with their confirmed password; the password itself is verified only after this role check, so a correct password does not bypass it.","commonSituations":"Role changes after the page was opened; new collaborators invited as members trying to enable terminal; assuming per-server policy alone governs the switch.","solutions":["Ask a team admin or owner to toggle terminal access for the server","Have an owner promote the member to admin if they should manage terminal access","Reload the page - the UI should reflect the current role before you retry","Check the user's membership role in the team members screen if access seems wrong"],"exampleFix":"// blade: before\n<button wire:click=\"toggleTerminal(...)\">Toggle</button>\n\n// blade: after\n@if(auth()->user()->isAdmin())\n    <button wire:click=\"toggleTerminal(...)\">Toggle</button>\n@endif","handlingStrategy":"validation","validationCode":"if (! auth()->user()->isAdmin()) {\n    // hide/disable the terminal toggle in the UI before toggleTerminal is invoked\n}","typeGuard":null,"tryCatchPattern":"Catch \\Exception (and the incorrect-password string return) in the action; dispatch('error', ...) for the role failure and keep the password-confirmation path separate so users know which check failed.","preventionTips":["Render the toggle only for admins/owners","Confirm your team role on the members screen before trying","Reload the page after role changes"],"tags":["authorization","terminal","team-roles","server"],"backgroundTag":"authorization-denied","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}