Configuring the Roles and Permission in Radsystems Studio (PHPRad Classic)

By enabling the model_has_role table in your project and configuring it.

is there an easy way to enable multi trier sites in RS?
all records are marked by site_id field, and a customer see only his/her site data.
(all queries have where site_id=[current_site] , the last one is a global variable.

There is no easy way, but the best way is to create a field to identify users of a specific site/company and use the where clause to limit the records to be displayed. You will also have to find a way to do the checks for view, edit, add, and delete.

1 Like

thank you willvin!
i would normally keep a user site variable in the session and use it as a variable in all sql where clauses.
does RS support variables in SQL?

Radsystems uses Laravel framework for generating Classic projects, so functions available in laravel are usable in Radsystems Studio-generated Laravel projects.

$query->where("email", "=" , "fieldvalue");

You can read more here.

1 Like

Thank you willvin
this is a great integration. can i assume that RAD simplifies usage of Laravel because it has IDE? you do i still need to learn Laravel to a full extend?

Yes in a way. Radsystems Studio uses the laravel framework to generate crud applications in minutes using the database provided by you.

You only need the basics of php and laravel, understanding functions available and how to use them. If you have requirements that Radsystems Studio does not support yet and would do a lot of custom coding, then you will have to learn laravel more.

1 Like

Sir the default role value i think you need to put an optional like enable or disable because when i try it out for register default value is staff and then when i add a new admin account it’s automatically role value as staff even i modify it putting a admin role it’s still the staff was putting in. i hope your devs fix it soon.