Skip to content

Bug in checking user permissions for guest #35

@ghost

Description

Hi.
It's been driving me crazy for about 4 hours now, but I think I've solved it.
When one tries to check permissions for an unauthenticated user (guest), a wrong assertion that $user['User']['user_group_id'] is set causes the process to fail, creating a weird query like:
...UserGroupPermission.user_group_id = OR...
I've managed to patch it by further editing (your edited) authsome.php (line 57):
from:
return $userModel->UserGroup->isUserGroupAccess($user['User']['user_group_id'],$access);
to:
/* NITZ DID IT*/
if(isset($user['User']))
return $userModel->UserGroup->isUserGroupAccess($user['User']['user_group_id'],$access);
else return $userModel->UserGroup->isUserGroupAccess(3,$access);

to make it use 3 (guest account) as the account type, when there's no account to be found.
I'd try to fix it myself in the source code, but it'd be rude and I'm real new to git (signed up to make this comment)
Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions