Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Group ACL support - #24

Merged
kjetilk merged 18 commits into
masterfrom
feature-group-acl
Jul 13, 2018
Merged

Group ACL support#24
kjetilk merged 18 commits into
masterfrom
feature-group-acl

Conversation

@dmitrizagidulin

Copy link
Copy Markdown
Contributor

Corresponds with solid-server PR nodeSolidServer/node-solid-server#719

@kjetilk

kjetilk commented Jul 6, 2018

Copy link
Copy Markdown
Contributor

I can't get group ACLs working yet: https://pastebin.com/92cB4BB8

@kjetilk

kjetilk commented Jul 6, 2018

Copy link
Copy Markdown
Contributor

Here's my group listing:

@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .

<> a acl:GroupListing.

<#meandi>
    a vcard:Group;
    vcard:hasUID <urn:uuid:8831CBAD-1111-2222-8563-F0F4787EG398:ABGroup> ;
    
    

  # Simply local and remote identity for myself
  vcard:hasMember </profile/card#me>;
  vcard:hasMember <https://solid.kjernsmo.net/profile/card#me>.

I don't know what the UID is, so I just put something in there. Isn't this about the minimal group listing there could be?

@timbl timbl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing jumps out as broken from cursory looking at the diffs

@RubenVerborgh RubenVerborgh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works. But the code is not in good shape (just so we know).

Comment thread package.json
},
"description": "Web Access Control based permissions library",
"main": "./lib/index",
"main": "./src/index",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong. Unless we're not transpiling anymore.

Comment thread package.json
"files": [
"lib"
"lib",
"src"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…but if we're not transpiling, what is lib doing here?

Comment thread src/group-listing.js
*/
constructor (options = {}) {
this.uri = options.uri
this.uid = options.uid

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get rid of this. It doesn't seem to serve any purpose. Or does it, @dmitrizagidulin?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man, I do not remember...

Comment thread src/group-listing.js
if (!rdfType) {
console.warn(`Possibly invalid group '${uri}', missing type vcard:Group`)
}
this.uid = graph.anyValue(group, ns.vcard('hasUID'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go.

Comment thread src/group-listing.js
this.rdf = options.rdf
this.graph = options.graph
if (this.rdf && this.graph) {
this.initFromGraph(this.graph, this.rdf)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't work. initFromGraph expects uri as first param.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…but we're not using this, I guess.

Comment thread src/group-listing.js
this.uid = options.uid
this.members = options.members || new Set()
this.listing = options.listing
this.rdf = options.rdf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be options.rdf || require('rdflib')

Comment thread src/group-listing.js
this.members = options.members || new Set()
this.listing = options.listing
this.rdf = options.rdf
this.graph = options.graph

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be options.graph || this.rdf.graph()

Comment thread src/permission-set.js
let groupMatches = graph.match(fragment, vocab.acl('agentGroup'))
let groupMatches = graph.match(fragment, ns.acl('agentGroup'))
groupMatches = groupMatches.map(ea => {
return new GroupListing({ listing: ea })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not result in a parsed group (missing params).

@kjetilk
kjetilk merged commit fd4fcbd into master Jul 13, 2018
@kjetilk
kjetilk deleted the feature-group-acl branch July 13, 2018 10:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants