Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Access Level
-
- Posts: 114
- Joined: Sun Sep 29, 2019 12:40 pm
Access Level
I have an access level called admin. There are 3 users with this access level. I now need to block 1 user from 1 tabs on a particular form. The form has 3 tabs
Main File maintenance Reports
I need to block the user from the reports tab.
Thanks
Main File maintenance Reports
I need to block the user from the reports tab.
Thanks
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: Access Level
Hi,
Add this in your form's Custom Code:
Add this in your form's Custom Code:
Code: Select all
if (nuUserName() == 'replace_with_user_name') {
nuHideTabByTitle('Reports');
}
-
- Posts: 114
- Joined: Sun Sep 29, 2019 12:40 pm
Re: Access Level
Thanks Kevin
Is this available in 4.5 only. I am still running 4
I get an error when I add this to before Edit
Is this available in 4.5 only. I am still running 4
I get an error when I add this to before Edit
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: Access Level
What error do you get?
if the function nuHideTabByTitle(s) is not available in v4, you can "borrow" it from v4.5.:
https://github.com/nuBuilder/nuBuilder- ... m.js#L2390
if the function nuHideTabByTitle(s) is not available in v4, you can "borrow" it from v4.5.:
https://github.com/nuBuilder/nuBuilder- ... m.js#L2390
-
- Posts: 114
- Joined: Sun Sep 29, 2019 12:40 pm
Re: Access Level
This is the error
Before Edit of Form FF17
/home1/ccchubda/public_html/ccchubdev/nucommon.php(1255) : eval()'d code
Call to undefined function nuUserName()
Traced from...
(line:42) /home1/ccchubda/public_html/ccchubdev/nuapi.php - nuBeforeEdit
(line:67) /home1/ccchubda/public_html/ccchubdev/nuform.php - nuEval
(line:1255) /home1/ccchubda/public_html/ccchubdev/nucommon.php - eval
an you explain how to borrow the function
Before Edit of Form FF17
/home1/ccchubda/public_html/ccchubdev/nucommon.php(1255) : eval()'d code
Call to undefined function nuUserName()
Traced from...
(line:42) /home1/ccchubda/public_html/ccchubdev/nuapi.php - nuBeforeEdit
(line:67) /home1/ccchubda/public_html/ccchubdev/nuform.php - nuEval
(line:1255) /home1/ccchubda/public_html/ccchubdev/nucommon.php - eval
an you explain how to borrow the function
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: Access Level
It looks like the code is not in the form's Custom code. Just place nuHideTabByTitle() under Setup -> Header or also in the form's Custom Code field.

Code: Select all
function nuHideTabByTitle(s) {
var tabs = JSON.parse(JSON.stringify(nuSERVERRESPONSE)).tabs;
var l = tabs.findIndex(data => data.title === s);
if (l > -1) nuHide('nuTab' + l);
}
if (nuUserName() == 'replace_with_user_name') {
nuHideTabByTitle('Reports');
}

-
- Posts: 114
- Joined: Sun Sep 29, 2019 12:40 pm
Re: Access Level
Thanks kevin
I have done that and dont get an error. Unfortunately the user is on leave so will not be able to check until thursday.
I have done that and dont get an error. Unfortunately the user is on leave so will not be able to check until thursday.
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore