@@ -612,14 +612,21 @@ UI.aclControl.ACLControlBox5 = function (subject, dom, noun, kb, callback) {
612612 var q = str . indexOf ( '//' )
613613 var targetDocDir = ( ( q >= 0 && p < q + 2 ) || p < 0 ) ? null : str . slice ( 0 , p + 1 )
614614
615- if ( targetDocDir ) {
615+ // @@ TODO: The methods used for targetIsStorage are HACKs - it should not be relied upon, and work is
616+ // @@ underway to standardize a behavior that does not rely upon this hack
617+ // @@ hopefully fixed as part of https://github.com/solid/data-interoperability-panel/issues/10
618+ const targetIsStorage = kb . holds ( targetDoc , UI . ns . rdf ( 'type' ) , UI . ns . space ( 'Storage' ) , targetACLDoc )
619+ const targetAclIsProtected = hasProtectedAcl ( targetDoc )
620+ const targetIsProtected = targetIsStorage || targetAclIsProtected
621+
622+ if ( ! targetIsProtected && targetDocDir ) {
616623 UI . acl . getACLorDefault ( $rdf . sym ( targetDocDir ) , function ( ok2 , p22 , targetDoc2 , targetACLDoc2 , defaultHolder2 , defaultACLDoc2 ) {
617624 if ( ok2 ) {
618625 prospectiveDefaultHolder = p22 ? targetDoc2 : defaultHolder2
619626 }
620627 addDefaultButton ( prospectiveDefaultHolder )
621628 } )
622- } else {
629+ } else if ( ! targetIsProtected ) {
623630 addDefaultButton ( )
624631 }
625632
@@ -685,4 +692,10 @@ UI.aclControl.ACLControlBox5 = function (subject, dom, noun, kb, callback) {
685692 renderBox ( )
686693 return table
687694} // ACLControlBox
695+
696+ function hasProtectedAcl ( targetDoc ) {
697+ // @@ TODO: This is hacky way of knowing whether or not a certain ACL file can be removed
698+ // Hopefully we'll find a better, standardized solution to this - https://github.com/solid/specification/issues/37
699+ return targetDoc . uri === targetDoc . site ( ) . uri
700+ }
688701// ends
0 commit comments