message: display alert or confirm if no Write or Control
diff: @@ -8,8 +8,10 @@ import { graph, NamedNode, UpdateManager } from 'rdflib'
  import { AccessGroups } from './access-groups'
  import { DataBrowserContext } from 'pane-registry'
  import { shortNameForFolder } from './acl-control'
  +import { currentUser } from '../authn/authn'
  import utils from '../utils.js'
  import * as debug from '../debug'
  +import ns from '../ns'
  /**
  * Rendered HTML component used in the databrowser's Sharing pane.
  @@ -215,6 +217,7 @@ export class AccessController {
  }
  public save (): Promise<void> {
  + // build graph
  const newAClGraph = graph()
  if (!this.isContainer) {
  makeACLGraphbyCombo(newAClGraph, this.targetDoc, this.mainCombo.byCombo, this.targetACLDoc, true)
  @@ -226,8 +229,27 @@ export class AccessController {
  // Linked controls
  makeACLGraphbyCombo(newAClGraph, this.targetDoc, this.mainCombo.byCombo, this.targetACLDoc, true, true)
  }
  +
  const updater = newAClGraph.updater || new UpdateManager(newAClGraph)
  - return new Promise((resolve, reject) => updater.put(
  +
  + // save ACL resource
  +
  + return new Promise((resolve, reject) => {
  + // check acl for acl:Write alert and acl:Control confirm
  + const hasWrite = newAClGraph.any(undefined, ns.acl('mode'), ns.acl('Write'), this.targetACLDoc)
  + const hasControl = newAClGraph.any(undefined, ns.acl('mode'), ns.acl('Control'), this.targetACLDoc)
  + const user = currentUser()
  + const webId = user ? user.uri : 'user'
  + if (!hasWrite) {
  + alert('There is no "Write access" this is not allowed')
  + return reject(new Error('ACL file save rejected : no acl:Write'))
  + } else if (!(hasControl || confirm('There is no "owners access" this is a dangerous situation !!!,' +
  + `\nAs ${webId}\nyou may definitly lose access to the resources covered by this ACL !!!` +
  + '\n\nDo you confirm ?'))) {
  + return reject(new Error('ACL file save canceled by user'))
  + } else {
  + // save acl
  + updater.put(
  this.targetACLDoc,
  newAClGraph.statementsMatching(undefined, undefined, undefined, this.targetACLDoc),
  'text/turtle',
  @@ -246,6 +268,8 @@ export class AccessController {
  debug.log('ACL modification: success!')
  resolve()
  }
  - ))
  + )
  + }
  + })
  }
  }
  