@@ -32,8 +32,29 @@ const tasks_func = (function () {
3232 if ( ! g_db . _exists ( a_subject_id ) )
3333 throw [ g_lib . ERR_NOT_FOUND , "Subject, '" + a_subject_id + "', does not exist" ] ;
3434
35- // Check for proper permissions
36- g_lib . ensureAdminPermRepo ( a_client , a_repo_id ) ;
35+ // Add detailed debugging via temporary error
36+ var repo = g_db . repo . document ( a_repo_id ) ;
37+ var adminEdge = g_db . admin . firstExample ( {
38+ _from : a_repo_id ,
39+ _to : a_client . _id ,
40+ } ) ;
41+
42+ // Create debug info string
43+ var debugInfo = [
44+ "ALLOC_DEBUG:" ,
45+ "Client=" + ( a_client ? a_client . _id : "undefined" ) ,
46+ "IsAdmin=" + ( a_client ? a_client . is_admin : "undefined" ) ,
47+ "Repo=" + a_repo_id ,
48+ "RepoAdmins=" + ( repo . admins ? JSON . stringify ( repo . admins ) : "none" ) ,
49+ "AdminEdge=" + ( adminEdge ? "exists" : "missing" ) ,
50+ "Subject=" + a_subject_id
51+ ] . join ( " | " ) ;
52+
53+ // Temporarily throw the debug info as an error so it appears in logs
54+ throw [ g_lib . ERR_INTERNAL_FAULT , debugInfo ] ;
55+
56+ // Original permission check (commented out temporarily)
57+ // g_lib.ensureAdminPermRepo(a_client, a_repo_id);
3758
3859 // Check if there is already a matching allocation
3960 var alloc = g_db . alloc . firstExample ( {
0 commit comments