Hello, by default I have that if you are not an administrator user can not access the edit page, the edit page, is passed as argument the user id, but I want that a user can access to edit your page, but not the others, now I have the function isAuthorized, this way:
public function isAuthorized($user) {
if((!isset($user['role'])) || ('' === $user['role'])) {
return false;
}
else {
if('edit' === $this->request->getParam('action')) {
if('admin' === $user['role']) {
return true;
}
elseif('user' === $user['role']) {
return false;
}
}
else {
return true;
}
}
}
}
But if the user matches your id you can edit. Something like that:
if('edit/23' === $this->request->getParam('action'))
if($user['id'] === 23} {
return true;
}
}