#84: Corrected permissions query for a non-admin user returning incorrect child albums
This commit is contained in:
parent
9a65e8f1c9
commit
eedfd5abdd
@ -70,7 +70,9 @@ class DbHelper
|
||||
->leftJoin('permissions AS group_permissions', 'group_permissions.id', '=', 'album_group_permissions.permission_id')
|
||||
->leftJoin('permissions AS user_permissions', 'user_permissions.id', '=', 'album_user_permissions.permission_id')
|
||||
->leftJoin('user_groups', 'user_groups.group_id', '=', 'album_group_permissions.group_id')
|
||||
->where('albums.user_id', $user->id)
|
||||
->where(function($query) use ($user, $permission)
|
||||
{
|
||||
$query->where('albums.user_id', $user->id)
|
||||
->orWhere([
|
||||
['group_permissions.section', 'album'],
|
||||
['group_permissions.description', $permission],
|
||||
@ -81,6 +83,7 @@ class DbHelper
|
||||
['user_permissions.description', $permission],
|
||||
['album_user_permissions.user_id', $user->id]
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
$parentAlbumID = intval($parentAlbumID);
|
||||
|
Loading…
Reference in New Issue
Block a user