Thus said "Andy Bradford" on 10 Sep 2014 00:26:12 -0600:
> As it turns out, this just doesn't seem possible with Fossil
> currently. Would there be any interest in something like:
Or how about something like this:
$ f diff
Index: src/login.c
==================================================================
--- src/login.c
+++ src/login.c
@@ -795,10 +795,11 @@
const char *zCookie; /* Text of the login cookie */
const char *zIpAddr; /* Raw IP address of the requestor */
char *zRemoteAddr; /* Abbreviated IP address of the requestor */
const char *zCap = 0; /* Capability string */
const char *zPublicPages = 0; /* GLOB patterns of public pages */
+ const char *zPrivatePages = 0;/* GLOB patterns of private pages */
const char *zLogin = 0; /* Login user for credentials */
/* Only run this check once. */
if( g.userUid!=0 ) return;
@@ -963,10 +964,22 @@
** permissions.
*/
zPublicPages = db_get("public-pages",0);
if( zPublicPages!=0 ){
Glob *pGlob = glob_create(zPublicPages);
+ if( glob_match(pGlob, PD("REQUEST_URI","no-match")) ){
+ login_set_capabilities(db_get("default-perms","u"), 0);
+ }
+ glob_free(pGlob);
+ }
+ /* If the private-pages glob pattern is defined and REQUEST_URI matches
+ ** one of the globs in private-pages, then also add in all default-perms
+ ** permissions if the user is not "nobody".
+ */
+ zPrivatePages = db_get("private-pages",0);
+ if( zPrivatePages!=0 && !login_is_nobody() ){
+ Glob *pGlob = glob_create(zPrivatePages);
if( glob_match(pGlob, PD("REQUEST_URI","no-match")) ){
login_set_capabilities(db_get("default-perms","u"), 0);
}
glob_free(pGlob);
}
This allows me to create users that don't have the the ability to clone
or checkout content but can still view the docs in the globbed
directories and they are required to have a login to see them (nobody is
not allowed):
Andy
--
TAI64 timestamp: 4000000054100b13
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users