Make a user admin for a table using TablePermission_Loaded (v2022)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mansour
User
Posts: 282

Make a user admin for a table using TablePermission_Loaded (v2022)

Post by mansour »

Hi,
Is there possible to make a specific user ADMIN for a specific table using TablePermission_Loaded server event?
e.g.

    $SupportStaff = Profile()->get("SupportStaff");
    if ($SupportStaff == 'Y') {
    $this->addUserPermission($this->currentUserLevelName(), "supportpanel", ALLOW_LIST);
}

in the above example ALLOW_LIST should be replaced with ???

Thanks


arbei
User
Posts: 9384

Post by arbei »

It depends what permissions exactly you want to grant to the user .You can grant the admin permission (ALLOW_ADMIN for v2022) to the user, but note that it is not same as system administrator permission. You cannot make a user an administrator (like the super admin or any user from the Administrator User Level) by UserLevel_Loaded server event addUserPermission(). You may read User Level -> Important Notes on User Levels.

You can use TablePermission_Loading server event and grant administrator user level to the user by addUserLevel(), but note that when the users become administrator, the user can see everything, e.g. all menu items.


Post Reply