linuxmuster / linuxmuster-webui7

Next generation web interface for linuxmuster.net v7.
https://www.linuxmuster.net
GNU General Public License v3.0
12 stars 8 forks source link

Redirect to landing page if user lacks permission #97

Closed zefanja closed 5 years ago

zefanja commented 5 years ago

When I want to login as a teacher I get this error (trying to access the landing page):

Security Error: Permission "lm:users:teachers:read" is required

The landing page does not load because of that.

zefanja commented 5 years ago

Looks like ajenti saves the last accessed site. So if I was logged in with global-admin before and edited some students / teachers (e.g. /view/lm/users/teachers) and then log out and log in again as a teacher it will redirect to that page and result in the error above.

kiarn commented 5 years ago

Hello @zefanja,

Looks like ajenti saves the last accessed site.

That's right. I will see if it's possible to redirect to the landing page after login if the user have no permission for the saved path.

PLanB2008 commented 5 years ago

@kiarn how about redirect to the root on logout / autologout (expired session)

so redirecting on logout from https://server:8000/view/lm/users/schooladmins to https://server:8000

kiarn commented 5 years ago

@PLanB2008 : good idea. I read the code from ajenti to redirect to root if user has not sufficient permission, but it's not so easy.

kiarn commented 5 years ago

Pull request done here : https://github.com/ajenti/ajenti/pull/1173