File tree 1 file changed +7
-6
lines changed
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(
151
151
if let Ok ( parent) = resource. get_parent ( store) {
152
152
check_rights ( store, & parent, for_agent, right)
153
153
} 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
+ }
159
160
// resource has no parent and agent is not in rights array - check fails
160
161
Err ( crate :: errors:: AtomicError :: unauthorized ( format ! (
161
162
"No {} right has been found for {} in this resource or its parents" ,
162
- right, for_string
163
+ right, for_agent
163
164
) ) )
164
165
}
165
166
}
You can’t perform that action at this time.
0 commit comments