Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.0

Bug #15434 With complex perm container, unimplyRight removes more records then it should.
Submitted: 2008-12-29 05:25 UTC
From: pcharb Assigned:
Status: Open Package: LiveUser_Admin (version 0.3.9)
PHP Version: 5.2.4 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2008-12-29 05:25 UTC] pcharb (Louis-Pierre Charbonneau)
Description: ------------ When you do: $data = array('right_id' => 10,'implied_right_id' => 16); $LUA->perm->unimplyRight($data); The following sql is issued: DELETE FROM liveuser_right_implied WHERE implied_right_id IN (16) The right_id in the $data array is ignored. This is a problem when more then one right, implies a particular right. Test script: --------------- $data = array('application_define_name' => 'mytestapp'); $appId = $LUA->perm->addApplication($data); $data = array('application_id' => $appId,'area_define_name' => 'mytestarea'); $areaId = $LUA->perm->addArea($data); $data = array('area_id' => $areaId, 'right_define_name' => 'super1'); $super1Id = $LUA->perm->addRight($data); $data = array('area_id' => $areaId, 'right_define_name' => 'super2'); $super2Id = $LUA->perm->addRight($data); $data = array('area_id' => $areaId, 'right_define_name' => 'implied'); $impliedId = $LUA->perm->addRight($data); $data = array('right_id' => $super1Id,'implied_right_id' => $impliedId); $LUA->perm->implyRight($data); $data = array('right_id' => $super2Id,'implied_right_id' => $impliedId); $LUA->perm->implyRight($data); $data = array('right_id' => $super2Id,'implied_right_id' => $impliedId); $LUA->perm->unimplyRight($data); echo "right_id: $super1Id - implied_right_id: $impliedId"; Expected result: ---------------- Only one record is deleted from the database, we have one record remaining record, namely $super1Id implies impliedId. Actual result: -------------- All records that have the same implied_right_id are deleted.

Comments