Dynamic user levels

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

Dynamic user levels

Post by ahti16 »

I have created many views where I can't give access to the standard user. Now I found that if I use lookup function from those views in page where i have access for standard user, I dont see the values what comes from restricted views. How can I set permissions so that the standard user can't access to the views but can see lookup values from views?


mobhar
User
Posts: 11726

Post by mobhar »

Similar to my answer in this post: viewtopic.php?f=4&t=44229&p=138747#p138747

As mentioned in that post, at least you MUST give "List" permission for that Database View (assumed View you mentioned above is the Database View), so that the lookup values will be populated properly.

If you don't want your standard user access that Database View, then you may simply hide the related menu item by using "MenuItem_Adding" server event.

If you want to prevent that standard user access the List page directly (even the related menu item has been hidden), then simply put this following code also in "Page_Render" server event that belongs to the List page of that Database View:

if (CurrentUserLevel() == "1") { // assume the standard user has userlevel = 1
$this->terminate("index.php"); // this will prevent standard user to access the List page, and system will redirect to the index.php page
}

Please read "Server Events and Client Scripts" topic from PHPMaker Help menu for more info and example.


Adam
User
Posts: 480

Post by Adam »

I think the Lookup_Selecting event will solve the problem - check my posts here:
http://www.hkvforums.com/viewtopic.php?f=4&t=43604


Post Reply