backup: add api "enablerestore"

This commit is contained in:
Anton Suhorukov 2021-06-30 16:33:49 +03:00
parent db7954ee31
commit d04484a2eb
2 changed files with 20 additions and 1 deletions

View File

@ -280,7 +280,7 @@ namespace ASC.Data.Backup
return result;
}
private void DemandPermissionsRestore()
public void DemandPermissionsRestore()
{
PermissionContext.DemandPermissions(SecutiryConstants.EditPortalSettings);

View File

@ -267,5 +267,24 @@ namespace ASC.Data.Backup.Controllers
return BackupHandler.GetTmpFolder();
}
///<visible>false</visible>
[Read("enablerestore")]
public bool EnableRestore()
{
try
{
if (CoreBaseSettings.Standalone)
{
TenantExtra.DemandControlPanelPermission();
}
BackupHandler.DemandPermissionsRestore();
return true;
}
catch
{
return false;
}
}
}
}