crysfel/Bleextop — Issue #11: Permissions [getByUserApplication]
Author: joel-e
Created: 2011-12-12 19:16:12+00:00
State: open

I encountered a scenario when I had assigned a user multiple roles ('Users' and 'Visitors'). On a given app, 'Users' were allowed and 'Visitors' were denied. The user was denied access because the 'Visitors' role was the last value selected. The user could be assigned roles and permissions differently to allow access, but I think in cases of conflict, allow should be given precedence over deny, so I modified the code as follows:

```php
if (!isset($permissions[$r["action"]]) || $r["value"] === "1") {
$permissions[$r["action"]] = $r["value"] === "1";
}
```
https://github.com/crysfel/Bleextop/blob/master/application/libraries/permissionsbi.php#L35