I am trying to create a .acl for a folder ‘prueba’ with permissions only for my account, and i have the next method:
`private createACL() {
let file = 'https://mypod.solid.community//prueba/.acl';
let content = '@prefix acl: <http://www.w3.org/ns/auth/acl#> .\n'+
'<#authorization1>\n'+
'a acl:Authorization;\n'+
'acl:agent <https://mypod.solid.community/profile/card#me>;\n'+
'acl:accessTo <https://mypod.solid.community//prueba/>;\n'+
'acl:mode acl:Read,\n'+
'acl:Write,\n'+
'acl:Control.\n'
this.fileClient.updateFile(file,content).then(success => {
console.log(`New ACL for ${file}.`)
}, err => console.log(err));
}`
I think the structure of the acl is right (i used the acl spec, and with the same steps i can create a normal file.
But i cant create the acl, i hava a folder, but it hasnt got the acl.
Edit:
This is the code that works:
private createACL () {
let file = 'https://mypod.solid.community/test/.acl';
let content = '@prefix acl: <http://www.w3.org/ns/auth/acl#>. \ n' +
'<#owner> \ n' +
'a acl: Authorization; \ n' +
'acl: agent <https://mypod.solid.community/profile/card#me>; \ n' +
'acl: accessTo <https://mypod.solid.community/test/>; \ n' +
'acl: defaultForNew <./>;' +
'acl: mode \ n acl: Read, \ n' +
'acl: Write, \ n' +
'acl: Control. \ n' +
'<#reader> \ n' +
'a acl: Authorization; \ n' +
'acl: defaultForNew <./>;' +
'acl: accessTo <https://mypod.solid.community/test/>; \ n' +
'acl: mode acl: Read; \ n' +
'acl: agent <https://otherpod.inrupt.net/profile/card#me>.'
this.fileClient.updateFile (file, content) .then (success => {
console.log (`Created $ {file} .`)
}, err => console.log (err));
}
Dou you mean that the .acl file is not in the folder after you run updateFile() or that the file is there but it does not have the permissions impact you expect? Did you intend the double-slashes in //prueba in your accessTo and the file name?
I am using Solid Explorer to see the .acl of the folder, and there isnt any rule for prueba, it is just empty.
I tried with \\prueba\, \prueba\, \\prueba and \prueba and nothing work
Maybe i am writing bad the content of the acl.
I don’t know how Solid Explorer works, but with the data browser and with Solid IDE you can enter the full URL e.g. https://mypod.solid.community/prueba/.acl and see .acl files. They do not show up in any regular directory listings by design, you need to ask for them specifically.
I am using the basic pod explorer, the solid community explorer, and when i am going to look the acl, it said there isnt any acl for prueba.
I have made more tries, too, and after a couple of times i get this with the next code:
I dont know what is g_L…, but is empty.
And when i change ‘acl:Control.’ to ‘acl:Control.\n’, i lost the control of the folder. I am in the 7 test, becouse i cant delete the previous six test.
The error says it is trying to parse your file as Notation3 yet the file contents are in Turtle. Try to force the content-type when you write the file like this: fileClient.updateFile( file, content, “text/turtle” ).
Just to confirm: (1) when you upload the file without specifying content-type, it gives you the Notation3 error and creates the file /prueba9/.acl. and (2) when you upload the same content with “text-turtle” specified as the content type, the Notation3 error goes away but the file gets named /prueba9/.acl.ttl.
(1) When i upload without specifying, it creates the .acl right, if there is a mistake like forgetting the /n after the acl:Control, then it creates a .acl with a error in it and the Nonatition3, but if i write it without any mistke, i lose the access to the folder. (2) yes