A
A
andr20172016-08-29 16:00:04
PHP
andr2017, 2016-08-29 16:00:04

Where should the access check code be in the controller or model?

//checking is the driver? on success true
public static function isDriver() {
return Security::isAllowedForCurrentUser('trips_driver');
}
public static function isSecretary() {
return Security::isAllowedForCurrentUser('trips_secretary');
}
ps Called only in the controller.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav, 2016-08-29
@andr2017

Of course in a controller, the model only returns data, and the controller already contains the logic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question