Restricting to Edit Form

Questions related to using nuBuilder Forte.

Restricting to Edit Form

Postby markzeryk » Thu Nov 07, 2019 11:52 pm

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?
markzeryk
 
Posts: 14
Joined: Sat Nov 02, 2019 4:37 pm

Re: Restricting to Edit Form

Postby Janusz » Fri Nov 08, 2019 7:01 am

Hi,
Group you can identify with:
https://wiki.nubuilder.net/nubuilderforte/index.php/Javascript#nuAccessLevelCode
You can open any form browse or edit with:
https://wiki.nubuilder.net/nubuilderforte/index.php/Javascript#nuForm

But
If you want to be more secure you have to limit the data for specific user for example like:
https://forums.nubuilder.com/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).
Janusz
 
Posts: 257
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Restricting to Edit Form

Postby kev1n » Fri Nov 08, 2019 3:28 pm

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!');
}
kev1n
 
Posts: 359
Joined: Mon Oct 15, 2018 2:13 am

Re: Restricting to Edit Form

Postby markzeryk » Tue Nov 12, 2019 8:59 pm

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!
markzeryk
 
Posts: 14
Joined: Sat Nov 02, 2019 4:37 pm


Return to General