Skip to content

Commit a70ef66

Browse files
committed
controlador rol terminado
1 parent 9ca1bff commit a70ef66

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

controllers/RolController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,36 @@ public function __construct() {
1111

1212
public function getAllRoles() {
1313
// Devolver todos los roles
14+
return $this->rolModel->getAllRoles();
1415
}
1516

1617
public function getRoleByName($name) {
1718
// Devolver el rol con el nombre
19+
return $this->rolModel->getRoleByName($name);
1820
}
1921

2022
public function addRole($data) {
2123
// Agregar un rol
24+
return $this->rolModel->addRole($data['name'], $data['description']);
2225
}
2326

2427
public function updateRole($id, $data) {
2528
// Actualizar un rol
29+
return $this->rolModel->updateRole($id, $data['name'], $data['description']);
2630
}
2731

2832
public function deleteRole($roleId) {
2933
// Eliminar un rol
34+
return $this->rolModel->deleteRole($roleId);
3035
}
3136

3237
public function assignPermission($roleId, $permissionId) {
3338
// Asignar un permiso a un rol
39+
return $this->rolModel->assignPermission($roleId, $permissionId);
3440
}
3541

3642
public function revokePermission($roleId, $permissionId) {
3743
// Revocar un permiso de un rol
44+
return $this->rolModel->revokePermission($roleId, $permissionId);
3845
}
3946
}

0 commit comments

Comments
 (0)