FM-HAM and authorization scripting

I have added the custom functions for FM-HAM into my file, with a single table (preferences) and single record to hold the groups as per the installation instructions. The json in the field is valid.
in the users table, that is checked on login, there is a single field that holds the privilege set name, which matches a privilege set in the preferences table (preferencesHAM TO, cartesian join).
on login, I am calling the payload, to get the user id, which then gets the privilege set name using getColumn.
I want to hide menu features based on the privilege set name.
The Custom function for HAM_Config is called in a set variable, as follows:

HAM_Config (

//param1: define groups JSON schema
PreferencesHAM::HAM_Groups ;

//param2: define current user
JSONSetElement ( "" ; 

[ "group" ; Users::group ; JSONString ]
 );

//param3: options
""

)

this kicks an error for invalid json.

what I would like to have happen is to set the app model to: app.menu.~theprivset and have a visible_calc look at app.menu~privset to display certain items…

what did I miss?
Jesse

Can you post the values of the arguments too, if it’s invalid JSON, we would need to see that JSON also.

this is the Ham_groups field in the preferences table:

{

"schoolUser":

{

"schoolMenu": true,

"viewDiocese": false,

"viewNCEA": false

},

"schoolLeader": {

"inherit": ["schoolUser"]

},

"diocesanUser": {

"inherit": ["schoolUser"],

"viewDiocese": true,

"viewNCEA": false

},

"diocesanLeader": {

"inherit": ["schoolUser"],

"viewDiocese": true,

"viewNCEA": false

}

}

the field in the user table that holds the privilege set holds:
[“dioceseUser”]

Can you try to manually paste in the settings, you can do this via the FM calc data viewer window and test that way. Then, compare that to the example file to see what is different.

in the data viewer, I am getting a good result. when the script runs in the OnBefore, I get the error. do I need to navigate in the script to the pref layout or the user layout?

yup, BF hooks are not bound to context
Really you should use a getPref type custom function for stuff like that