Fixes some issues with the ACL queries

This commit is contained in:
Marcos Zuriaga 2016-10-04 20:46:59 +02:00
parent 352338fc77
commit 00149bb912
No known key found for this signature in database
GPG key ID: 7D15585354D072FF
2 changed files with 3 additions and 2 deletions

View file

@ -82,7 +82,7 @@ class ShareRequest extends PermissionEntity implements \JsonSerializable {
return [
'item_id' => $this->getItemId(),
'item_guid' => $this->getItemGuid(),
'user_id' => $this->getFromUserId(),
'user_id' => $this->getTargetUserId(),
'created' => $this->getCreated(),
'permissions' => $this->getPermissions(),
'vault_id' => $this->getTargetUserId(),

View file

@ -43,7 +43,8 @@ class ShareRequestMapper extends Mapper {
* @return ShareRequest[]
*/
public function getRequestsByItemGuid($item_guid){
$q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME . " WHERE item_guid = ? GROUP BY user_id";
$this->db->executeQuery("SET sql_mode = '';");
$q = "SELECT *, target_user_id FROM *PREFIX*" . self::TABLE_NAME . " WHERE item_guid = ? GROUP BY target_user_id;";
return $this->findEntities($q, [$item_guid]);
}