applab Posted October 7, 2013 Share Posted October 7, 2013 Hi All, Another ex-modxer here. After 6 years of Evo I've tried my best to bond with Revo and it's just not happening. I've built one simple site with PW and it was a delight to work with so now I'm hoping it's able to cope with the next two projects I have lined up, both of which are quite involved. If I was doing my next project in Modx it would require several custom db-tables and I'd be coding a number of custom admin screens whereas with PW I get the impression that I could do *everything* using standard features. Anyway, here's my first question... The site I'm working on has three types of users (ok, 4 if you include 'guest'). Only one type ('staff') will have access to the backend. The two front-end user types are 'student' & 'agent'. The fields I need to store for 'student' are different to those for 'agent', which are different to those for 'staff'. So, is it possible to have a different set of fields available for each user type? Any pointers on how I might approach this in PW would be much appreciated. Thanks, Martin. Link to comment Share on other sites More sharing options...
adrian Posted October 7, 2013 Share Posted October 7, 2013 Hi applab and welcome to PW! Maybe check out this module: http://modules.processwire.com/modules/page-edit-field-permission/ and see if that can do what you need. Link to comment Share on other sites More sharing options...
applab Posted October 7, 2013 Author Share Posted October 7, 2013 Hi Adrian, Thanks for the welcome, and the link. I can certainly see me finding a use for that module but it doesn't cover my requirements in this instance. I need the fields that are shown to be dependent not on the currently logged in user, but the on the type of user being editing. I.e. It will always be 'staff' who are in the back-end editing 'students' & 'agents', but I'd like a different set of fields depending on which it is. My current thinking is along these lines: 1) create 3 roles [staff,agent,student] 2) add all fields for all roles to the user template 3) use a hook to hide some fields depending on the role of the edited user (not the editing user!) If anyone with more experience can see a flaw in my plan or suggest a better method then I'm all ears. thanks, Martin. Link to comment Share on other sites More sharing options...
apeisa Posted October 7, 2013 Share Posted October 7, 2013 that is good way to go. But you can also easily built custom profile pages for your clients to edit. Those can be process modules (admin usage), like ProcessStudentEdit. That way you could extend things like student search etc. welcome Martin! Link to comment Share on other sites More sharing options...
applab Posted October 7, 2013 Author Share Posted October 7, 2013 hi apeisa, Thanks for the pointer. I haven't built an admin module yet, is this what you're referring to? https://github.com/ryancramerdesign/ProcessHello cheers, Martin. Link to comment Share on other sites More sharing options...
apeisa Posted October 7, 2013 Share Posted October 7, 2013 yep, that is great starting point. remember that on module scope you need wire("pages") instead of $pages (same for all API variables). 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