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.

drh 2020-04-13 20:16 trunk
Commit b3a346e0e621173a3e7aae15ea5d5418be2b11afcdb64021e3778eb280e7a972
1 file changed +4 -11
+4 -11
--- src/name.c
+++ src/name.c
@@ -1226,16 +1226,13 @@
12261226
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
12271227
style_header("List Of Artifacts");
12281228
style_submenu_element("250 Largest", "bigbloblist");
12291229
if( g.perm.Admin ){
12301230
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");
12371234
}
12381235
if( g.perm.Private || g.perm.Admin ){
12391236
if( !privOnly ){
12401237
style_submenu_element("Private", "bloblist?priv");
12411238
}
@@ -1291,15 +1288,11 @@
12911288
const char *zUuid = db_column_text(&q, 1);
12921289
const char *zDesc = db_column_text(&q, 2);
12931290
int isPriv = db_column_int(&q,3);
12941291
int isPhantom = db_column_int(&q,4);
12951292
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 ){
13011294
/* Don't show private artifacts to users without Private (x) permission */
13021295
continue;
13031296
}
13041297
if( hashClr ){
13051298
const char *zClr = db_column_bytes(&q,1)>40 ? zSha3Bg : zSha1Bg;
13061299
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button