Пример #1
0
function deleteUserRoles()
{
    global $db, $id;
    $approleDAO = new ApproleDAO($db);
    if ($role = $approleDAO->load($id)) {
        $appuserroleDAO = new AppuserroleDAO($db);
        foreach ($appuserroleDAO->findByRole_name($role->role_name) as $permrow) {
            $appuserroleDAO->delete($permrow->id);
        }
    }
}
Пример #2
0
function deleteRoles()
{
    global $db, $id;
    $appuserroleDAO = new AppuserroleDAO($db);
    foreach ($appuserroleDAO->findByUser_id($id) as $rolerow) {
        $appuserroleDAO->delete($rolerow->id);
    }
}