File tree Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -32,14 +32,15 @@ See [STATUS.md](server/STATUS.md) to learn more about which features will remain
3232- Fix index issue happening when deleting a single property in a sorted collection #545
3333- Update JS assets & playwright
3434- Fix initial indexing bug #560
35- - Fix errors on succesful export / import #565
3635- Fix envs for store path, change ` ATOMIC_STORE_DIR ` to ` ATOMIC_DATA_DIR ` #567
3736- Refactor static file asset hosting #578
3837- Meta tags server side #577
3938- Include JSON-AD in initial response, speed up first render #511
4039- Remove feature to index external RDF files and search them #579
4140- Add staging environment #588
4241- Add systemd instructions to readme #271
42+ - Improve check_append error #558
43+ - Fix errors on successful export / import #565
4344
4445## [ v0.34.0] - 2022-10-31
4546
Original file line number Diff line number Diff line change @@ -69,22 +69,24 @@ pub fn check_append(
6969 resource : & Resource ,
7070 for_agent : & str ,
7171) -> AtomicResult < String > {
72- let parent = if let Ok ( parent) = resource. get_parent ( store) {
73- parent
74- } else {
75- if resource
76- . get_classes ( store) ?
77- . iter ( )
78- . map ( |c| c. subject . clone ( ) )
79- . collect :: < String > ( )
80- . contains ( urls:: DRIVE )
81- {
82- return Ok ( String :: from ( "Drive without a parent can be created" ) ) ;
72+ let parent = match resource. get_parent ( store) {
73+ Ok ( p) => p,
74+ Err ( e) => {
75+ if resource
76+ . get_classes ( store) ?
77+ . iter ( )
78+ . map ( |c| c. subject . clone ( ) )
79+ . collect :: < String > ( )
80+ . contains ( urls:: DRIVE )
81+ {
82+ return Ok ( String :: from ( "Drive without a parent can be created" ) ) ;
83+ }
84+ return Err ( AtomicError :: unauthorized ( format ! (
85+ "Can't append to {} because it's parent cannot be found: {}" ,
86+ resource. get_subject( ) ,
87+ e
88+ ) ) ) ;
8389 }
84- return Err ( AtomicError :: unauthorized ( format ! (
85- "No parent found for {}" ,
86- resource. get_subject( )
87- ) ) ) ;
8890 } ;
8991 if let Ok ( msg) = check_rights ( store, & parent, for_agent, Right :: Append ) {
9092 Ok ( msg)
You can’t perform that action at this time.
0 commit comments