File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
packages/web-backend/src/Videos Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ export class VideosPolicy extends Effect.Service<VideosPolicy>()(
1818 Effect . fn ( function * ( user ) {
1919 const res = yield * repo . getById ( videoId ) ;
2020
21- if ( Option . isNone ( res ) ) return true ;
21+ if ( Option . isNone ( res ) ) {
22+ yield * Effect . log ( "Video not found. Access granted." )
23+ return true ;
24+ }
2225
2326 const [ video , password ] = res . value ;
2427
@@ -40,11 +43,16 @@ export class VideosPolicy extends Effect.Service<VideosPolicy>()(
4043 if (
4144 Option . isNone ( videoSpaceShareMembership ) &&
4245 Option . isNone ( videoOrgShareMembership )
43- )
46+ ) {
47+ yield * Effect . log ( "Neither org nor space sharing found. Access denied." )
4448 return false ;
49+ }
4550 }
4651 } else {
47- if ( ! video . public ) return false ;
52+ if ( ! video . public ) {
53+ yield * Effect . log ( "Video is private and user is not logged in. Access denied." )
54+ return false ;
55+ }
4856 }
4957
5058 yield * Video . verifyPassword ( video , password ) ;
@@ -73,4 +81,4 @@ export class VideosPolicy extends Effect.Service<VideosPolicy>()(
7381 SpacesRepo . Default ,
7482 ] ,
7583 } ,
76- ) { }
84+ ) { }
You can’t perform that action at this time.
0 commit comments