Fossil SCM
Allow non-privileged users to see phantom artifacts in /bloblist. Private artifacts may still only be seen by high-privilege users. If an artifact is both private and a phantom, it is viewable because "private" in the context of a phantom is different from a real private artifact.
Commit
b3a346e0e621173a3e7aae15ea5d5418be2b11afcdb64021e3778eb280e7a972
Parent
7fd31f69571cae5…
1 file changed
+4
-11
+4
-11
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -1226,16 +1226,13 @@ | ||
| 1226 | 1226 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1227 | 1227 | style_header("List Of Artifacts"); |
| 1228 | 1228 | style_submenu_element("250 Largest", "bigbloblist"); |
| 1229 | 1229 | if( g.perm.Admin ){ |
| 1230 | 1230 | style_submenu_element("Artifact Log", "rcvfromlist"); |
| 1231 | - if( !phantomOnly ){ | |
| 1232 | - style_submenu_element("Phantoms", "bloblist?phan"); | |
| 1233 | - } | |
| 1234 | - }else{ | |
| 1235 | - privOnly = 0; | |
| 1236 | - phantomOnly = 0; | |
| 1231 | + } | |
| 1232 | + if( !phantomOnly ){ | |
| 1233 | + style_submenu_element("Phantoms", "bloblist?phan"); | |
| 1237 | 1234 | } |
| 1238 | 1235 | if( g.perm.Private || g.perm.Admin ){ |
| 1239 | 1236 | if( !privOnly ){ |
| 1240 | 1237 | style_submenu_element("Private", "bloblist?priv"); |
| 1241 | 1238 | } |
| @@ -1291,15 +1288,11 @@ | ||
| 1291 | 1288 | const char *zUuid = db_column_text(&q, 1); |
| 1292 | 1289 | const char *zDesc = db_column_text(&q, 2); |
| 1293 | 1290 | int isPriv = db_column_int(&q,3); |
| 1294 | 1291 | int isPhantom = db_column_int(&q,4); |
| 1295 | 1292 | const char *zRef = db_column_text(&q,6); |
| 1296 | - if( isPhantom && !g.perm.Admin ){ | |
| 1297 | - /* Do not show phantom artifacts to non-admin users */ | |
| 1298 | - continue; | |
| 1299 | - } | |
| 1300 | - if( isPriv && !g.perm.Private && !g.perm.Admin ){ | |
| 1293 | + if( isPriv && !isPhantom && !g.perm.Private && !g.perm.Admin ){ | |
| 1301 | 1294 | /* Don't show private artifacts to users without Private (x) permission */ |
| 1302 | 1295 | continue; |
| 1303 | 1296 | } |
| 1304 | 1297 | if( hashClr ){ |
| 1305 | 1298 | const char *zClr = db_column_bytes(&q,1)>40 ? zSha3Bg : zSha1Bg; |
| 1306 | 1299 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -1226,16 +1226,13 @@ | |
| 1226 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1227 | style_header("List Of Artifacts"); |
| 1228 | style_submenu_element("250 Largest", "bigbloblist"); |
| 1229 | if( g.perm.Admin ){ |
| 1230 | style_submenu_element("Artifact Log", "rcvfromlist"); |
| 1231 | if( !phantomOnly ){ |
| 1232 | style_submenu_element("Phantoms", "bloblist?phan"); |
| 1233 | } |
| 1234 | }else{ |
| 1235 | privOnly = 0; |
| 1236 | phantomOnly = 0; |
| 1237 | } |
| 1238 | if( g.perm.Private || g.perm.Admin ){ |
| 1239 | if( !privOnly ){ |
| 1240 | style_submenu_element("Private", "bloblist?priv"); |
| 1241 | } |
| @@ -1291,15 +1288,11 @@ | |
| 1291 | const char *zUuid = db_column_text(&q, 1); |
| 1292 | const char *zDesc = db_column_text(&q, 2); |
| 1293 | int isPriv = db_column_int(&q,3); |
| 1294 | int isPhantom = db_column_int(&q,4); |
| 1295 | const char *zRef = db_column_text(&q,6); |
| 1296 | if( isPhantom && !g.perm.Admin ){ |
| 1297 | /* Do not show phantom artifacts to non-admin users */ |
| 1298 | continue; |
| 1299 | } |
| 1300 | if( isPriv && !g.perm.Private && !g.perm.Admin ){ |
| 1301 | /* Don't show private artifacts to users without Private (x) permission */ |
| 1302 | continue; |
| 1303 | } |
| 1304 | if( hashClr ){ |
| 1305 | const char *zClr = db_column_bytes(&q,1)>40 ? zSha3Bg : zSha1Bg; |
| 1306 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -1226,16 +1226,13 @@ | |
| 1226 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1227 | style_header("List Of Artifacts"); |
| 1228 | style_submenu_element("250 Largest", "bigbloblist"); |
| 1229 | if( g.perm.Admin ){ |
| 1230 | style_submenu_element("Artifact Log", "rcvfromlist"); |
| 1231 | } |
| 1232 | if( !phantomOnly ){ |
| 1233 | style_submenu_element("Phantoms", "bloblist?phan"); |
| 1234 | } |
| 1235 | if( g.perm.Private || g.perm.Admin ){ |
| 1236 | if( !privOnly ){ |
| 1237 | style_submenu_element("Private", "bloblist?priv"); |
| 1238 | } |
| @@ -1291,15 +1288,11 @@ | |
| 1288 | const char *zUuid = db_column_text(&q, 1); |
| 1289 | const char *zDesc = db_column_text(&q, 2); |
| 1290 | int isPriv = db_column_int(&q,3); |
| 1291 | int isPhantom = db_column_int(&q,4); |
| 1292 | const char *zRef = db_column_text(&q,6); |
| 1293 | if( isPriv && !isPhantom && !g.perm.Private && !g.perm.Admin ){ |
| 1294 | /* Don't show private artifacts to users without Private (x) permission */ |
| 1295 | continue; |
| 1296 | } |
| 1297 | if( hashClr ){ |
| 1298 | const char *zClr = db_column_bytes(&q,1)>40 ? zSha3Bg : zSha1Bg; |
| 1299 |