Closed frthjf closed 8 months ago
Hi!
Thanks for the great plugin!
I believe there is an issue with the account access check logic here when the API key allows access to all libraries.
In that case, the request returns a response like this:
{ "user": { "library": true, "files": true, "notes": true }, "groups": { "all": { "library": true, "write": false } } }
Thus, the condition if (account.access.groups[library.id]) will always be false. A potential fix would be to change the condition to account.access.groups[library.id] || account.access.groups['all']). I'm happy to prepare a PR if useful.
if (account.access.groups[library.id])
account.access.groups[library.id] || account.access.groups['all'])
Thanks!
Yep, a PR would be appreciated!
Hi!
Thanks for the great plugin!
I believe there is an issue with the account access check logic here when the API key allows access to all libraries.
In that case, the request returns a response like this:
Thus, the condition
if (account.access.groups[library.id])
will always be false. A potential fix would be to change the condition toaccount.access.groups[library.id] || account.access.groups['all'])
. I'm happy to prepare a PR if useful.Thanks!