| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php /** MicroFileRBAC */ |
||
| 55 | public function assign($userId, $name) |
||
| 56 | { |
||
| 57 | if ($this->searchRoleRecursive($this->roles, $name)) { |
||
| 58 | $exists = $this->db->exists('rbac_user', ['user' => $userId, 'role' => $name]); |
||
| 59 | if (!$exists) { |
||
| 60 | return $this->db->insert('rbac_user', ['role' => $name, 'user' => $userId]); |
||
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 64 | return false; |
||
| 65 | } |
||
| 66 | |||
| 78 |