Login as super-admin to the admin panel, create profiles and give them the permissions you want on each table and action.
Login to the Admin Panel as the Main Administrator
Use the credentials created during the installation of the authentication module
Open the Users Profiles
& click the Add new
button
Each of the tables used in the admin dashboard is shown as a set of 4 fields:
Open the Users
& click the Add new
button
Choose the new user's profile in the dropdown list, complete the user info & submit to add your new user.
If a user does not have the right to read on a table, the table will not be displayed in the side menu.
The URL will of course not be available either.
If a user does not have the creation/edit/deletion rights on a table, the corresponding buttons will not be displayed in the data table.
The URLs will of course not be available either.
The PHPCG authentication module allows you to create user profiles for which connected users only have access to their own records.
This allows, for example, to give access to a customer who will only see his own profile and orders.
To do this, each table to be restricted must be joined to the user table, directly or indirectly.
Open the Add new profile
or Edit profile
form
Set the Read
, Update
, Create/Delete
rights of the table you want to restrict to Restricted
in the drodown list
In the Constraint Query
field, enter the WHERE query to use to limit the user's rights
CURRENT_USER_ID
will be automatically replaced by PHPCG with the current connected user ID.
Example using the Direct Relation according to the Database shema above:
WHERE projects.phpcg_users_ID = CURRENT_USER_ID
Example using the Indirect Relation according to the Database shema above:
WHERE projects_details.projects_id = projects.id AND projects.phpcg_users_ID = CURRENT_USER_ID
To create users profiles and add new users you must beforehand: