Commit bd38646d authored by Ivanq's avatar Ivanq

Repo: Ask Merger:GitCenter permission before running mergerSiteList and mergerSiteAdd

parent 1ba41f8e
......@@ -11,7 +11,15 @@ class Repository {
// Permission actions
addMerger() {
return this.zeroPage.cmd("mergerSiteList")
return this.zeroPage.getSiteInfo()
.then(siteInfo => {
if(siteInfo.settings.permissions.indexOf("Merger:GitCenter") == -1) {
return zeroPage.cmd("wrapperPermissionAdd", ["Merger:GitCenter"]);
}
})
.then(() => {
return this.zeroPage.cmd("mergerSiteList");
})
.then(list => {
if(!list[this.address]) {
return this.zeroPage.cmd("mergerSiteAdd", [this.address]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment