-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when inheriting permissions from parent folder #5
Comments
Are you using the newest version? It sounds like the behaviour of an older version, so could you check that you have a build of version 0.1.0? To use the latest version, you can clone it from github, run |
Ok, I think I found the root of the issue. I didn't update the dist folder in github in the last months, so it likely hasn't included the patch for loading the default from the parent. I've updated it now, so if you reinstall it in your project it should work. But I'd suggest you to somehow add a version to your dependency, else changes in this project which are not backwards compatible could break yours. I don't know how you could do this, building it yourself should work I guess. |
And as a side note. You could use shortcuts to replace this let p = new Permissions();
p.add(READ);
let a = new Agents();
a.addWebId("https://aliceuniovi.inrupt.net/profile/card#me");
try {
await acl.addRule(p, a);
console.log("updated acl")
} catch (e) { with try {
await acl.addRule(READ, "https://aliceuniovi.inrupt.net/profile/card#me");
console.log("updated acl")
} catch (e) { The first param of |
Oh wow, it does indeed work now, just the update was required. However, have done some testing and looks like if the only acl found is the one of the root of the pod, nothing is done (haven't really tested deeply as it is not now works for what i require) Wasn't expecting for you to answer so fast, thanks a ton. And... I did really enjoy that sidenote of yours, it will make stuff easier 😄. |
I'm glad that it helped you, good luck with your project :)
If the parent has an acl file, it should find it and use the defaults (if it has any) from this file. Else continue with the grandparent, etc. until the root which must have an acl file. So if it uses the acl file from root, either there is no folder in between with an acl file, or the library has a bug. |
Cheers @Otto-AA , I have recently been using your library in a project and I have stumbled upon some problems.
I am trying to edit permissions on a file without .acl (it inherits permissions from parent directory) and whenever I change them to add someone to read a file, I get a 403 status when accessing my file, however, the other user is able of reading it.
I have my file with such permissions.
And using this code I try to add someone with read:
When executed, the following is printed in the console:
And the other user can download the json with no problem, but, if I try to access.
And, as unable to read the file nor the .acl, I don't know what the permissions are or what happened.
If instead of READ, I give other permissions like, CONTROL. The other user can read the .acl (thus not edit it nor download the json file (this is odd)) and shows the following:
Not sure where I am messing up, but I've tried different approaches for some time while checking the provided example, yet with no avail.
Kind regards and sorry for such a long "I need help" post.
The text was updated successfully, but these errors were encountered: