Jump to content
blynx

User as a child of a user

Recommended Posts

Hi,

is it somehow possible to add new users as children of other users?

I want to group users and thought that would be a nice structure to have groups of users put together as children of other users. Basically like:

Users
  Group A
    User 1
    User 2
    User 3
  Group B
    User 4
    User 5
    User 6
    User 7
  ... 

 I edited the user template to be able to have children and parents of user-templates - yet, whenever I add a child to a user it automatically will be appended to the 'Users' page. Also I cant move them from there, it says "You do not have permission to move pages using this parent - /backend/access/users/group-a/"

Couldn't find a solution so far - I think there is some intention behind it, because it is some admin/system stuff - but couldn't it be made possible?

-Steffen

Share this post


Link to post
Share on other sites

What about using user roles for this scenario instead?

  • Like 1

Share this post


Link to post
Share on other sites

Not sure if this solves your needs in another way, but check out this module:

https://processwire.com/talk/topic/5658-alpha-release-usergroups-page-based-permissions/

But, you might also be able to achieve what you want through some recent additions to dev which allows for parents for users:

http://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users

  • Like 2

Share this post


Link to post
Share on other sites

@marcus

I thought about that but I don't want to spam the roles with hundreds of groups.

Also I could add another page which hold those groups which hold the according users. I will try to do this now - but I thought that first solution would be something clever and 'semantically neat' ... uhm or so ...

edit:

@adrian

Aha!

I think I will try out the latest dev version - I think this is exactly what I thought of!

Thank you, both of you!

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Andi
      Getting a little deeper into the ProcessWire state-of-mind here. I seriously think I wouldn't have come back to webdev if it wasn't for this wonderful little gem of a CMS.
      I have an "Options" field added to all users on a site. If the user has anything other then "default" selected, I would like to show a permanent message in the admin like the one in the screenshot, only so that the user can't close it. As a friendly reminder that he changed that option from default to something crazy 🙂
      I've read up on how to send messages to users, but where would I hook into to make this show up all the time in the backend?
      https://processwire.com/api/ref/wire/message/
      Thanks in advance!

    • By BitPoet
      Here's a small new module that adds a "Manage tags" button to the template list, just like the field list already has.
      Easily add, remove and change tags for your templates.
      https://github.com/BitPoet/TemplateTagsEditList

    • 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 Noel Boss
      👋 PW Pros…
      I have some hooks that I need to bind at the init phase (or even __construct) and I was wondering, and I couldn't find a good and simple way to determine if I'm in the admin. Would be nice if there is a reliable short option to do so, but I can't seem to find one… Is there a coherent way to tell this no matter where I am?
      Right now, I use the following method inside one of my modules:
      public function isAdmin($page = null) { if ( strpos($this->input->url, $this->urls->admin) !== false || $this->process instanceof ProcessPageList || $this->process instanceof ProcessPageEdit || ($page instanceof Page && $page->rootParent->id == $this->config->adminRootPageID) ) { return true; } return false; } @ryan wouldn't it be nice to have something like wire()->isAdmin(); like wire()->user->isLoggedin(); to tell if we are in admin – very early on (probably even in __construct() phase of modules?
×
×
  • Create New...