Jump to content

Remove most of the admin features for specific roles


Tino
 Share

Recommended Posts

Hi,

I'm working on a dashboard with some functionality that will be used by two roles "user" and "management". These both roles should not see anything else in the admin-header-section than the dashboard, like in this screenshot.

1477823061_Screenshot2022-09-08at19_55_07.thumb.png.837c5e7add7c6454c805493752873a39.png

Also while editing any elements they should not see "Settings" Delete and so on like seen here:

2048743042_Screenshot2022-09-08at19_54_45.thumb.png.81f27b2c2948140ce61ecaf0f65eaa2d.png

All these options should only appear for the "superuser" or "developer" for maintaining everything.

For the moment it would be ok if the options would be just "not visible" in the longterm it would be awesome to find a way to really block every user not in the specific role. In my actual case the users would not try to hack something but everybody know to better be safe than sorry ?

Maybe it is related to that topic also:

I noticed if I put all fields of a template in a "FieldsetTabOpen" the "Content"-Tab is still shown and have some wired actions (after switching to an other tab and back it shows the content of the former tab).

It would be no problem to completely remove that "Content"-Tab at all by a hook and only work with "FieldsetTabOpen".

 

I hope I could somehow explain what I would like to archive.

Thank you all

  • Like 1
Link to comment
Share on other sites

But role is a thing, and permissions is another and this last is what you are looking for. Look there - https://processwire.com/docs/user-access/permissions/ - and try to play with them, then give a look at those modules : 

https://processwire.com/modules/admin-restrict-page-tree/

https://processwire.com/modules/custom-admin-menus/

 

For example, I have a role "accountant" and he do not have access to the page tree or any other features than the "accounting" module.

 

1177330320_Screenshot2022-09-09072125.png.937c187ea0bcc7e1adff36c271649f9f.png

Edited by flydev ??
modules
  • Like 4
Link to comment
Share on other sites

Thank you for the hint with the modules also.

If I just use the AdminRestrictPageTree module it also hides my self created dashboard. But I created the Dashboard by myself and not with the module mentioned in your answer. I will give that a try also.

And of course you were totally right and I‘m sorry for my bad wording here. Yes I was talking about permissions and not roles.

I will play around and also have a look inside the mentioned modules to maybe get some ideas out of the code.

Thank you

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...