Jump to content
Pete Jones

Frontend user login and access levels

Recommended Posts

Hi,

We're looking at creating a 3 level (guest, member, admin) user levels for accessing frontend content via a login.

I have seen https://processwire.com/talk/topic/107-custom-login/page-1 which talks about creating the user login page. I have also seen http://modules.processwire.com/modules/frontend-user/ which is an older module which seemingly handles this but is still in alpha.

We are creating a system where users need to login to see comments (members) but admin users are able to see additional information on some pages. What I'm looking for is something a little like:

if ($user->role == 'admin') {

//SHOW DETAILED INFORMATION

} else {

//SHOW  BASIC INFORMATION

}

Can we hook into the User roles to do this?

Thanks

Pete

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By abdulqayyum
      Dear processwire community,
      i have a problem in loginRegister module, i could not add custom field in login and register page.
      i read from plugin documentation. they are saying.
      " By default, the email and password fields are required for both forms. You may want to add more fields. To do this, you’ll need to add fields to your “user” template. You can add fields to your user template in the admin by going to “Setup > Templates > Show system templates > user”.

      but i could not find similar scenario like “Setup > Templates > Show system templates > user”
      i can see just "Setup > Templates" not seeing "Show system templates > user" in my admin panel.

      Please help me in this case that how i can add custom field in these two page.
      Regards AbdulQayyum

    • By prestoav
      Hi there,
      I have a marketplace site that used the older Fredi module for front end editing so advertisers can create and edit their adverts (in the form of pages). After upgrading to v3.0 of Processwire I'd like to change the editing method for users to the new, core front end editing methods. However, it seems that with this method any editor can edit any page (subject to template restrictions for their user role). Using Fredi I checked the user and created user were equal before displaying edit buttons (clunky but it worked).
      Is there any stock way to restrict front end editing to the creator of the page so that my advertisers can only edit their own ads or should I test for user as before?
      Thanks in advance as always 🙂
    • By DooM
      Hey guys!
      I try to achieve a possibility for the client's admin account to change other users privileges. 
      In the CMS I have superadmin account, which is for me. My client got an account with a role user, which is limited administration account. The client also got some other people, who will edit the content with role editor  
      User story would look somehow like this:
      user role can add new roles and users user role can change privileges for all users (except superadmin). Eg. When the user role gives the editor role privilege to edit only articles. The Editor role will be able to edit only them.  
      I know this functionality is possible for superadmin, but I couldn't simulate it on the user role. Is there any easy way to achieve such a feature? Otherwise, I'll have to make a module for this I guess.
      Thanks for any help!
    • By Anton
      Hi there,
      I'm working with Processwire 3. Before summer I had issues to load to my backend. I finally managed to connect thanks to this : 
      $admin = wire('users')->get('admin');
      $admin->setOutputFormatting(false);
      $admin->set('pass', 'yo12345ZZ')
      $admin->save('pass');
      But later, the problem evolved: when I logged in to the site, the login page redirected me to the home. I didn't find any information about it on the web.
      But recently, the redirection has changed, now it is the login page that reloads when you connect. 
      I don't know where to start to fix this. It looks like sorcery.
      Thank you for all the help you can give me.
       
    • By pwFoo
      Hi,
      I try to add page-edit-own and page-delete-own permissions, but it's strange...
      If a add the custom permissions it looks like both are children of page-edit respectively page-delete. I played with added / revoked permissions, but I can't get it work, that a user of a role just can delete own content.
      First the user can't delete any content and now the user can delete own and foreign pages 🤪
      Is there a tutorial to learn more about the PW permissions?
      Or do I have to rename the permissions to page-own-edit and page-own-delete to be independent from page-edit and page-delete?
×
×
  • Create New...