Greg Lumley Posted May 28, 2020 Share Posted May 28, 2020 Please pardon me if this is a silly question. I was wondering if anyone has designed a subscriber based system or any system where a user would create content and have rights to edit only that content. Something such as a listing site, craigslist etc? In my case I'd like to build some CRM management into my existing website. I'm asking roughly what your approach would or might have been ? I need a push. Thank you. Link to comment Share on other sites More sharing options...
huseyin Posted May 28, 2020 Share Posted May 28, 2020 The key would be the "page-edit-created" permission. Read : https://processwire.com/blog/posts/language-access-control-and-more-special-permissions/#limit-edits-to-pages-user-created-page-edit-created 1 Link to comment Share on other sites More sharing options...
rick Posted May 28, 2020 Share Posted May 28, 2020 Do you want this functionality available from the front-end or only from the admin side? 1 Link to comment Share on other sites More sharing options...
Greg Lumley Posted May 30, 2020 Author Share Posted May 30, 2020 On 5/28/2020 at 9:19 PM, rick said: Do you want this functionality available from the front-end or only from the admin side? Hi Rick, I'd like it to be a front-end as in "user admin", so essentially a custom front end admin. If that makes sense. ? Link to comment Share on other sites More sharing options...
rick Posted May 30, 2020 Share Posted May 30, 2020 (edited) Hi @Greg Lumley, Implementing a "user admin" on the front-end isn't difficult because of PW's API -- In theory, that is. If you aren't familiar with PHP, or aren't familiar with the API, then it obviously will be a little more difficult. You can ask any questions here in the forum and a plethora of highly-skilled programmers will be glad to help. That's another big selling point with PW vs any other. The community support is second to none. The following is an example break-down of one of my sites. I have one site where specific users have the only permissions to access specific pages. All other users could only view pages. Think of it like the *nix RGE permission structure, where Root is super user, Group is any registered user, and Everyone else is a guest just visiting. PW initially gives you the Root and Everyone roles, so you will need to add the Group role. You can name it what you want. And since I don't let *any* user access the PW admin, I don't need to specify any permissions, such as page-edit, etc. I use Processwire's built-in page management to further limit a user to only their pages. Specifically, all pages have a created_users_id, and other information that is saved each time a page is created or updated. So when a user wants to create a new entry (page) their $user->id is assigned to the created_users_id property. Now I have a one-to-many relationship between a user and all of their pages. I also have different sections where a user can create a page. For example, when a user logs into my site acme.com, they can create a page under "high-explosives", and another page under "jet-powered devices". They may not wish to create a page under any other section. Each section has it's own template, so I can easily use selectors to retrieve the user pages by section, or even retrieve all pages. The front-end "user admin" interface is simply a two column layout with a menu on the left and the content on the right. I use the Group role to determine the menu options. I obviously don't want one user viewing details of another user, except for me as super user (Root). This also restricts the admin page(s) from view by the Everyone (Guest) role. I also have a drill-down capability from this initial user admin page to get more specific details. Each user can manage their own personal data page as well. That is the basic overview. The next thing are the modules. If you do not have your own login system then I would recommend LoginRegisterPro as it covers all the bases (register, login, forgot password, etc.) that you will need for your user access requirements. I am currently looking into implementing @bernhard's RockFinder3 module to handle queries because I have many users and they each have many pages and I want to be as efficient as possible. You must have TracyDebugger. That is a requirement (should be in core ? ). It will save you many hundreds of hours of scratchin' your head. You may elect to use other modules, such as caching, etc. These are just the minimum I would recommend for a project like yours. I hope this helps. Edited May 30, 2020 by rick added links 4 Link to comment Share on other sites More sharing options...
Greg Lumley Posted May 31, 2020 Author Share Posted May 31, 2020 Hi Rick, thank you for the answer. This helps a lot! G Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now