RE: checkRight function on the LiveUser object
"Jan Bolmeson" <[email protected]>
| Newsgroups | gmane.comp.php.pear.liveuser |
|---|---|
| Message-ID | <[email protected]> |
It is strange... It does not return the correct value on checkright, even
though I have tried almost everything I can think of. When I use the admin
functions I get it to work okey, but the $LU object doesn't seem to get the
same information. I have "logged off" and "logged on" again -
reinstanceiated the object but there is no difference. Am I making some
basic mistake?
Get all users in group 2:
---------------------------------------------------
array(1) {
0 => array(4) {
perm_user_id => string(1) 3
auth_user_id => string(1) 3
auth_container_name => string(2) DB
perm_type => string(1) 3
}
}
Get all rights assigned to group number 2:
--------------------------------------------
$params = array(
'fields' => array(
'right_id',
'right_define_name',
),
'with' => array(
'group_id' => array(
'fields' => array(
'group_id'
),
),
),
'filters' => array(
'group_id' => 2
),
//'limit' => 100,
//'offset' => 0,
);
return $this->admin->perm->getRights($params);
array(1) {
2 => array(4) {
right_id => string(1) 2
right_define_name => string(6) ACCESS
group_id => string(1) 2
groups => array(1) {
0 => array(1) {
group_id => string(1) 2
}
}
}
}
Output rights constants:
----------------------------------------------
array(2) {
qslaw_Administration_ACCESS => string(1) 2
qslaw_Administration_READ => string(1) 3
}
Get user rights:
-----------------------------------------------
$params = array(
'fields' => array(
'right_id',
'right_level'
),
'filters' => array(
'perm_user_id' => 3
)
);
print_r($admin->perm->getRights($params) );
array(1) {
3 => array(2) {
right_id => string(1) 3
right_level => string(1) 1
}
}
Hence the user should have right 3, level 1 (ACCESS) through the UserRight
container and right 2 thanks to the group membership to group with id 2.
LU->checkright(3):
--------------------------------------------------
bool false
LU->checkright(2):
--------------------------------------------------
bool false
$LU->getProperty('rights'):
---------------------------------------------------
array(0)
$LU->getProperty('groupRights'):
---------------------------------------------------
NULL
$LU->getProperty('groupIds'):
---------------------------------------------------
array(0)
$LU->getProperty('userRights'):
---------------------------------------------------
array(0)
Jan Bolmeson wrote:
> What do you mean by running the updateProperty() - how does that function
> relate to groupRights? I have also tried to destroy the object (both
client
> and admin) and then created it again (in order to try to "flush" the
> container) but it doesn't seem to work... :(
the updateProperty() method reloads all user data from the original
source, since any client instance doesnt know whats going on inside the
admin API. however creating a new client instance for the user should
serve the same purpose.
IIRC example 4 makes use of groups rights and i think it worked when i
tried it the other day ..
could you give the output of
$LU->getProperty('rights');
$LU->getProperty('groupRights');
$LU->getProperty('groupIds');
$LU->getProperty('userRights');
regards,
Lukas
--
Lukas Smith
[email protected]
_______________________________
BackendMedia
www.backendmedia.com
[email protected]
Linn Zwoch Smith GbR
Pariser Str. 44
D-10707 Berlin
Tel +49 30 83 22 50 00
Fax +49 30 83 22 50 07
_______________________________________________
LiveUser mailing list
[email protected]
http://mailman.21st-hq.de/mailman/listinfo/liveuser