File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -531,7 +531,7 @@ function App () {
531531 }
532532
533533 async function authorize ( req , res , next ) {
534- if ( ! req . url . startsWith ( '/user/' ) && ! req . url . startWith ( '/public/' ) ) {
534+ if ( ! req . url . startsWith ( '/user/' ) && ! req . url . startsWith ( '/public/' ) ) {
535535 next ( )
536536 return
537537 }
Original file line number Diff line number Diff line change @@ -83,8 +83,6 @@ async function getPrivilege (userIds, path) {
8383 uri = uri . split ( '/' ) . slice ( 0 , - 2 ) . join ( '/' )
8484 }
8585
86- console . log ( uri )
87-
8886 let user = await db . model . User . findAll ( {
8987 where : {
9088 id : userIds ,
@@ -104,20 +102,20 @@ async function getPrivilege (userIds, path) {
104102 }
105103 } )
106104
107- let usernames = await db . model . User . findAll ( {
105+ let userUris = await db . model . User . findAll ( {
108106 where : {
109107 id : userIds ,
110108 virtual : false
111109 }
112110 } ) . then ( results => {
113- return results . map ( result => result . username )
111+ return results . map ( result => databasePrefix + 'user/' + result . username )
114112 } )
115113
116114 let owners = await getOwnedBy ( uri , graph )
117115
118116 // If we're an owner, we upgrade the privilege
119117 owners . forEach ( owner => {
120- if ( usernames . includes ( owner ) ) {
118+ if ( userUris . includes ( owner ) ) {
121119 minPrivilege = 3
122120 }
123121 } )
You can’t perform that action at this time.
0 commit comments