changes to git management links based on perms
[gwvp.git] / gwvplib / gwvpgitcontrol.php
index d1b0699..7093812 100644 (file)
@@ -4,6 +4,7 @@ $CALL_ME_FUNCTIONS["gitcontrol"] = "gwvp_gitControlCallMe";
 
 //$MENU_ITEMS["20repos"]["text"] = "Repo Admin";
 //$MENU_ITEMS["20repos"]["link"] = "$BASE_URL/admin/repos";
+$HOME_PAGE_PROVIDERS["gitlog"] = "gwvp_GitLogProvider";
 
 function gwvp_gitControlCallMe()
 {
@@ -22,6 +23,11 @@ function gwvp_gitControlCallMe()
        
 }
 
+function gwvp_GitLogProvider()
+{
+       echo "<br>gitload provider loaded on homepage<br>";
+}
+
 function gwvp_repoPermissionCheck($repo, $user)
 {
        return true;
@@ -159,6 +165,15 @@ function gwvp_gitBackendInterface()
        }
 }
 
+function gwvp_canManageRepo($userid, $repoid)
+{
+       // only the owner or an admin can do these tasks
+       error_log("Checking repoid, $repoid against userid $userid");
+       
+       if(gwvp_IsUserAdmin(null, null, $userid)) return true;
+       if(gwvp_IsRepoOwner($userid, $repoid)) return true;
+       return false;
+}
 
 function gwvp_callGitBackend($repo)
 {