RE: Need help
Hi Dinh,
There are several ways of doing this.
1) One Is to create a "super user" role that enables users to edit anyones articles. You then assign that role to user A.
If it is important that the article_id be 8 and that the user who created the article be user_id = 4, you will have to make these checks manually as this is not related to the RBAC logic.
One you have done the test your pseudo code would look something like:
$user_id = 1
if ( isAllowedTo($user_id, 'read_edit', 'article')){
Do what ever you want here
}
|