Demo mode: Updated my account access to be more selective
This commit is contained in:
parent
e006f9674f
commit
49b286cd34
1 changed files with 5 additions and 1 deletions
|
@ -20,7 +20,6 @@ class UserAccountController extends Controller
|
||||||
) {
|
) {
|
||||||
$this->middleware(function (Request $request, Closure $next) {
|
$this->middleware(function (Request $request, Closure $next) {
|
||||||
$this->preventGuestAccess();
|
$this->preventGuestAccess();
|
||||||
$this->preventAccessInDemoMode();
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -53,6 +52,8 @@ class UserAccountController extends Controller
|
||||||
*/
|
*/
|
||||||
public function updateProfile(Request $request, ImageRepo $imageRepo)
|
public function updateProfile(Request $request, ImageRepo $imageRepo)
|
||||||
{
|
{
|
||||||
|
$this->preventAccessInDemoMode();
|
||||||
|
|
||||||
$user = user();
|
$user = user();
|
||||||
$validated = $this->validate($request, [
|
$validated = $this->validate($request, [
|
||||||
'name' => ['min:2', 'max:100'],
|
'name' => ['min:2', 'max:100'],
|
||||||
|
@ -143,6 +144,7 @@ class UserAccountController extends Controller
|
||||||
*/
|
*/
|
||||||
public function updateNotifications(Request $request)
|
public function updateNotifications(Request $request)
|
||||||
{
|
{
|
||||||
|
$this->preventAccessInDemoMode();
|
||||||
$this->checkPermission('receive-notifications');
|
$this->checkPermission('receive-notifications');
|
||||||
$data = $this->validate($request, [
|
$data = $this->validate($request, [
|
||||||
'preferences' => ['required', 'array'],
|
'preferences' => ['required', 'array'],
|
||||||
|
@ -178,6 +180,8 @@ class UserAccountController extends Controller
|
||||||
*/
|
*/
|
||||||
public function updatePassword(Request $request)
|
public function updatePassword(Request $request)
|
||||||
{
|
{
|
||||||
|
$this->preventAccessInDemoMode();
|
||||||
|
|
||||||
if (config('auth.method') !== 'standard') {
|
if (config('auth.method') !== 'standard') {
|
||||||
$this->showPermissionError();
|
$this->showPermissionError();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue