allow non-admin to create accounts without admin() priv

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sticcino
User
Posts: 1129

allow non-admin to create accounts without admin() priv

Post by sticcino »

Hi,

is there away to allow a user to create accounts without having to give them admin privilege to that table?

the form is pretty locked down for allowing them to edit their own record, but we need a user with a specific userlevel to create accounts with a predefined user level (this user will be able to create accounts that will have a specific use level id that can only view records. this level will be preset and they cannot select anything else or see any other levels or content.

not sure there's a workaround.
thanks


mobhar
User
Posts: 11947

Post by mobhar »

That is very easy to do with PHPMaker.

You may simply create a Database View based on your users table to achieve that. Just give Add permission to allow your desired user level to add a new record into that users table.

Of course, you may filter the options for UserLevel field in that Database View that lookup to userlevels table, so that the end-users are able to choose only the allowed user level that you need.

That's only the basic idea. You may enhance it that suits your business logic.


sticcino
User
Posts: 1129

Post by sticcino »

Hi Mobhar,

don't think you can add records thru a view... i tried a test there are no crud functions available... gave user every perm on the view as a test, as well as add on the actual table as well


mobhar
User
Posts: 11947

Post by mobhar »

As long as your Database View contains one single table, there should be no problem to perform CRUD operation in it.

In addition, make sure also from your Database View inside your PHPMaker project, it has the Primary Key, as well as it has for the original table.


Post Reply