how can I add the userpermission List.
I try the code in the UserLevel_Loaded
$this->AddUserPermission($this->GetUserLevelName(CurrentUserLevel()), “tablename”, ALLOW_LIST);But it is not working.
Your code looks correct, although it can be simplified to:$this->addUserPermission($this->currentUserLevelName(), “tablename”, ALLOW_LIST);You may also try the TablePermission_Loaded server, see the topic Server Events and Client Scripts in the help file.Make sure the letter case of “tablename” is correct, compare with that in the user level permission table.
on the UserLevel_Loaded() I try as -
$this->addUserPermission($this->currentUserLevelName(), “requeststatement”, ALLOW_LIST);and on the TablePermission_Loaded() I try as -
if (CurrentTable()->TableName == “requeststatement”)
$this->setCanList(TRUE);Both the above code is not working.
But if I give the List Permission from the userlevel and try to add the “ADD” permission manually then it is working
$this->addUserPermission($this->currentUserLevelName(), “requeststatement”, ALLOW_ADD);And if I want to add the LIST permission manually it is not working.
Your code should be correct. You thought it was “not working” probably because you changed the “List” permission of the table but the table was not shown in the menu. If so, you may try:$this->addUserPermission($this->currentUserLevelName(), “requeststatement”, ALLOW_LIST);
$this->saveUserLevel(); // Save the User Level to Session variable