Welcome Guest, Not a member yet? Register   Sign In
Myth Auth LoginFilter Problem
#17

(This post was last modified: 01-27-2024, 05:29 AM by Newbie_Mark998.)

i have applied this filter to restrict access to a certain url  in config/routes.php

PHP Code:
$routes->get('user/profile''User::profile', ['filter' => 'role:User']); 

[Image: HKC3ckd]
when i log in as another role user for example admin and i try to access the page  /user/profile   i get the above error

Myth\Auth\Exceptions\PermissionException
You do not have sufficient permissions to access that page.

however I want to redirect them to the main url

i could achieve it using $this->restrictToGroups('User','dashboard' ); but still dont know how to do using filters
Reply


Messages In This Thread
Myth Auth LoginFilter Problem - by ralphcabanero - 09-13-2020, 07:49 AM
RE: Myth Auth LoginFilter Problem - by InsiteFX - 09-13-2020, 08:19 AM
RE: Myth Auth LoginFilter Problem - by InsiteFX - 09-13-2020, 03:46 PM
RE: Myth Auth LoginFilter Problem - by raajaud - 12-01-2020, 08:10 PM
RE: Myth Auth LoginFilter Problem - by PwrSrg - 01-04-2021, 05:02 PM
RE: Myth Auth LoginFilter Problem - by InsiteFX - 09-14-2020, 08:47 AM
RE: Myth Auth LoginFilter Problem - by InsiteFX - 09-15-2020, 08:36 AM
RE: Myth Auth LoginFilter Problem - by InsiteFX - 12-02-2020, 11:06 AM
RE: Myth Auth LoginFilter Problem - by PwrSrg - 01-06-2021, 06:12 AM
RE: Myth Auth LoginFilter Problem - by Newbie_Mark998 - 01-27-2024, 04:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB