Demo mode: Updated my account access to be more selective

This commit is contained in:
Dan Brown 2023-10-30 12:07:18 +00:00
parent e006f9674f
commit 49b286cd34
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -20,7 +20,6 @@ class UserAccountController extends Controller
) {
$this->middleware(function (Request $request, Closure $next) {
$this->preventGuestAccess();
$this->preventAccessInDemoMode();
return $next($request);
});
}
@ -53,6 +52,8 @@ class UserAccountController extends Controller
*/
public function updateProfile(Request $request, ImageRepo $imageRepo)
{
$this->preventAccessInDemoMode();
$user = user();
$validated = $this->validate($request, [
'name' => ['min:2', 'max:100'],
@ -143,6 +144,7 @@ class UserAccountController extends Controller
*/
public function updateNotifications(Request $request)
{
$this->preventAccessInDemoMode();
$this->checkPermission('receive-notifications');
$data = $this->validate($request, [
'preferences' => ['required', 'array'],
@ -178,6 +180,8 @@ class UserAccountController extends Controller
*/
public function updatePassword(Request $request)
{
$this->preventAccessInDemoMode();
if (config('auth.method') !== 'standard') {
$this->showPermissionError();
}