Home » Authentication » LiveUser_Admin » Bug #4176
getRights() bug
Details
| Submitted | 2005-04-18 17:12 UTC |
|---|---|
| From | liveuser at mail dot ru |
| Status | Wont fix |
| Package | LiveUser_Admin |
| PHP Version | Irrelevant |
| OS | All |
| Roadmaps | (Not assigned) |
Comments
[2005-04-18 17:12 UTC] liveuser at mail dot ru
Description:
------------
Version: LiveUser_Admin 2.1
When trying to get right_level info about a group i'm getting an error: Couldn't create the query, reason: infinite recursion detected: rights
Reproduce code:
---------------
$data = array(
'fields' => array(
'right_id',
'right_define_name',
'right_level' /* if i'm asking for this value i'm getting an error */
),
'with' => array(
'area_id' => array(
'fields' => array(
'area_id'
),
),
),
'filters' => array(
'group_id' => $params['group_id']
)
);
$allGroupRights = $core->admin->perm->getRights($data);
Expected result:
----------------
I've digged a little and got a sql query:
SELECT liveuser_rights.right_id AS right_id,
liveuser_rights.right_define_name AS right_define_name,
liveuser_userrights.right_level AS right_level,
liveuser_rights.area_id AS area_id
FROM liveuser_rights, liveuser_userrights, liveuser_grouprights
WHERE liveuser_grouprights.group_id = '1' AND
liveuser_rights.right_id = liveuser_grouprights.right_id;
LiveUser SQL Builder is looking for liveuser_userrights.right_level, and not for liveuser_grouprights.right_level as it seems to be.
[2005-04-18 20:36 UTC] smith at backendmedia dot com
this looks like a really tricky design issue. could try fetching the data using the getRight methid instead? i will try to have a look myself tomorrow .. maybe we need to fix this with a field namr change. for now you should be able to solve this by using "grouprights.right_level" instead of "right_level"
[2005-04-19 07:42 UTC] liveuser at mail dot ru
Using "grouprights.right_level" instead of "right_level" gives me the
following error:
DB Error: unknown error
SELECT liveuser_rights.right_id AS right_id,
liveuser_rights.right_define_name AS right_define_name,
grouprights.right_level,
liveuser_rights.area_id AS area_id
FROM liveuser_grouprights, liveuser_rights
WHERE liveuser_grouprights.group_id = '1' AND
liveuser_rights.right_id = liveuser_grouprights.right_id
[nativecode=1109 ** Unknown table 'grouprights' in field list]
Using "liveuser_grouprights.right_level" instead of "right_level"
gives me this:
Couldn't create the query, reason: explicit table does not exist: liveuser_grouprights
Couldn't create the query, reason: no tables were found
So this does not help :(
I also havn't found getRight() method nor in LiveUser_admin Perm containers, nor in LiveUser Perm contatiners.
[2005-04-19 07:48 UTC] smith at backendmedia dot com
ermm i meant getGroups() .. sorry
also try "liveuser_grouprights.right_level"
[2005-04-19 08:28 UTC] liveuser at mail dot ru
"liveuser_grouprights.right_level" doesn't work - look at my previous post.
getGroups() work fine :)
[2005-04-19 10:32 UTC] smith at backendmedia dot com
ok i am marking this as a wont fix, because we will not fix the originally reported behaviour. aside from this the best course of action seems to be to use the getGroups() method in this case as it first tries the group tables and therefore never gets to the user tables. Furthermore I have fixed the explicit specification of tables in CVS.