File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -151,15 +151,16 @@ pub fn check_rights(
151151 if let Ok ( parent) = resource. get_parent ( store) {
152152 check_rights ( store, & parent, for_agent, right)
153153 } else {
154- let for_string = if for_agent == urls:: PUBLIC_AGENT {
155- "the Public Agent" . to_string ( )
156- } else {
157- for_agent. to_string ( )
158- } ;
154+ if for_agent == urls:: PUBLIC_AGENT {
155+ // resource has no parent and agent is not in rights array - check fails
156+ return Err ( crate :: errors:: AtomicError :: unauthorized (
157+ "This resource is not publicly visible. Try signing in" . to_string ( ) ,
158+ ) ) ;
159+ }
159160 // resource has no parent and agent is not in rights array - check fails
160161 Err ( crate :: errors:: AtomicError :: unauthorized ( format ! (
161162 "No {} right has been found for {} in this resource or its parents" ,
162- right, for_string
163+ right, for_agent
163164 ) ) )
164165 }
165166}
You can’t perform that action at this time.
0 commit comments