Page 1 of 1
Restricting to Edit Form
Posted: Thu Nov 07, 2019 3:22 pm
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?
Re: Restricting to Edit Form
Posted: Thu Nov 07, 2019 10:31 pm
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).
Re: Restricting to Edit Form
Posted: Fri Nov 08, 2019 6:58 am
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!');
}
Re: Restricting to Edit Form
Posted: Tue Nov 12, 2019 12:29 pm
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!