summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2021-06-25 17:03:32 +0200
committerVivien Kraus <vivien@planete-kraus.eu>2021-06-27 00:20:08 +0200
commit3fa20c06d56f3fe66ff3835e2363f04453c7c06e (patch)
treecbad2475edf6a6af2ce5da6c6ee24ee5178c1af1
parentfdcf468169983cafe603f125b5521e38018d808d (diff)
fixup! Implement the POST method for the server
-rw-r--r--src/scm/webid-oidc/server/create.scm20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/scm/webid-oidc/server/create.scm b/src/scm/webid-oidc/server/create.scm
index 93f684c..9209d70 100644
--- a/src/scm/webid-oidc/server/create.scm
+++ b/src/scm/webid-oidc/server/create.scm
@@ -62,24 +62,10 @@
(or (equal? next "http://www.w3.org/ns/ldp#BasicContainer")
(types-indicate-container? (cdr types))))))
-(define (check-acl-can-append server-name container owner user http-get)
- (let ((modes (wac-get-modes server-name container user #:http-get http-get)))
- (define (check-modes modes)
- (if (null? modes)
- (raise-exception
- (make-forbidden container user owner
- (string->uri "http://www.w3.org/ns/auth/acl#Append")))
- (or
- (equal? (car modes) (string->uri "http://www.w3.org/ns/auth/acl#Append"))
- (equal? (car modes) (string->uri "http://www.w3.org/ns/auth/acl#Write"))
- (check-modes (cdr modes)))))
- (check-modes modes)))
-
(define* (create server-name owner user container types slug content-type content
#:key
(http-get http-get))
- (unless (equal? owner user)
- (check-acl-can-append server-name container owner user http-get))
+ (check-acl-can-append server-name container owner user #:http-get http-get)
(unless (and slug (not (equal? slug "")))
(set! slug (stubs:random 12)))
(when (string-contains slug "/")
@@ -101,9 +87,7 @@
;; There’s no risk to have // here, because slug is
;; non-empty.
(if container? "/" "")))))
- (when (and slug
- (or (string-suffix? ".acl" slug)
- (string-suffix? ".meta" slug)))
+ (when (auxiliary-path? (uri-path doc-uri))
(raise-exception (make-path-is-auxiliary (uri-path doc-uri))))
(when container?
(without-containment-triples doc-uri content-type content))