Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Restricting to Edit Form

Questions related to using nuBuilder Forte.
Post Reply
markzeryk
Posts: 17
Joined: Sat Nov 02, 2019 8:07 am

Restricting to Edit Form

Unread post by markzeryk »

Hi,

I got 2 Access Levels with Codes

SuperUser
StandardUser

SuperUser must be given access to a Form for Edit and Browse
StandardUser must be given access to Form but only Edit


How can I set this and prevent the StandardUser user from opening the browse form?
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Restricting to Edit Form

Unread post by Janusz »

Hi,
Group you can identify with:
https://wiki.nubuilder.cloud/ ... sLevelCode
You can open any form browse or edit with:
https://wiki.nubuilder.cloud/ ... ipt#nuForm

But
If you want to be more secure you have to limit the data for specific user for example like:
https://forums.nubuilder.cloud/viewtopic.php?f=20&t=9953

because anyone from Console (F12) can force to display the form with for example:
nuForm('5c2cc83df422135','','','','') - the code is specfic for every from

or you can create 2 different forms one for each group and in JS you can swith/hide one or the other depending on the group - (in form type you can define what type the form should be and in access rigths define which group can acess it).
If you like nuBuilder, please leave a review on SourceForge
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Restricting to Edit Form

Unread post by kev1n »

I think the simplest way is to check the access level code in the PHP BB (Before Browse) event and display an error if the condition is not met.

Code: Select all

if ("#ACCESS_LEVEL_CODE#" == "StandardUser")
{
   nuDisplayError('Access denied for StandardUser!');
}
markzeryk
Posts: 17
Joined: Sat Nov 02, 2019 8:07 am

Re: Restricting to Edit Form

Unread post by markzeryk »

kev1n wrote:I think the simplest way is to check the access level code in the PHP BB (Before Browse) event and display an error if the condition is not met.

Code: Select all

if ("#ACCESS_LEVEL_CODE#" == "StandardUser")
{
   nuDisplayError('Access denied for StandardUser!');
}
works perfectly!
Post Reply