Merge branch 'develop' into feature/mobile-main-button
This commit is contained in:
commit
0e52607238
@ -1,6 +1,7 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
PUSHD %~dp0..
|
PUSHD %~dp0..
|
||||||
dotnet build ASC.Web.slnf /fl1 /flp1:LogFile=build/ASC.Web.log;Verbosity=Normal
|
dotnet build ASC.Web.slnf /fl1 /flp1:LogFile=build/ASC.Web.log;Verbosity=Normal
|
||||||
@echo off
|
|
||||||
echo.
|
echo.
|
||||||
echo Install nodejs projects dependencies...
|
echo Install nodejs projects dependencies...
|
||||||
echo.
|
echo.
|
||||||
@ -15,6 +16,8 @@ if %errorlevel% == 0 (
|
|||||||
|
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
|
POPD
|
||||||
|
|
||||||
if "%1"=="nopause" goto start
|
if "%1"=="nopause" goto start
|
||||||
pause
|
pause
|
||||||
:start
|
:start
|
@ -1,18 +1,27 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
echo "##########################################################"
|
||||||
|
echo "######### Start build and deploy #######################"
|
||||||
|
echo "##########################################################"
|
||||||
|
|
||||||
|
echo.
|
||||||
|
|
||||||
PUSHD %~dp0
|
PUSHD %~dp0
|
||||||
call runasadmin.bat "%~dpnx0"
|
call runasadmin.bat "%~dpnx0"
|
||||||
|
|
||||||
if %errorlevel% == 0 (
|
if %errorlevel% == 0 (
|
||||||
|
|
||||||
call start\stop.bat
|
call start\stop.bat nopause
|
||||||
|
|
||||||
PUSHD %~dp0..
|
|
||||||
|
|
||||||
echo "FRONT-END (for start run command 'yarn start' inside the root folder)"
|
echo "FRONT-END (for start run command 'yarn start' inside the root folder)"
|
||||||
call build\build.frontend.bat
|
call build.frontend.bat nopause
|
||||||
|
|
||||||
echo "BACK-END"
|
echo "BACK-END"
|
||||||
call build\build.backend.bat
|
call build.backend.bat nopause
|
||||||
|
|
||||||
start /b call build\start\start.bat
|
call start\start.bat nopause
|
||||||
|
|
||||||
|
echo.
|
||||||
|
|
||||||
pause
|
pause
|
||||||
)
|
)
|
@ -48,15 +48,24 @@ powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-studio.conf
|
|||||||
|
|
||||||
REM restart nginx
|
REM restart nginx
|
||||||
echo service nginx stop
|
echo service nginx stop
|
||||||
call sc stop nginx
|
call sc stop nginx > nul
|
||||||
|
|
||||||
REM sleep 5 seconds
|
REM sleep 5 seconds
|
||||||
call ping 127.0.0.1 -n 6 > nul
|
call ping 127.0.0.1 -n 6 > nul
|
||||||
|
|
||||||
echo service nginx start
|
echo service nginx start
|
||||||
call sc start nginx
|
call sc start nginx > nul
|
||||||
|
|
||||||
|
if NOT %errorlevel% == 0 (
|
||||||
|
echo Couldn't restarte Onlyoffice%%~nf service
|
||||||
)
|
)
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
echo.
|
||||||
|
|
||||||
|
POPD
|
||||||
|
|
||||||
if "%1"=="nopause" goto start
|
if "%1"=="nopause" goto start
|
||||||
pause
|
pause
|
||||||
:start
|
:start
|
@ -1,3 +1,9 @@
|
|||||||
|
echo "##########################################################"
|
||||||
|
echo "######### Start build and deploy Personal ##############"
|
||||||
|
echo "##########################################################"
|
||||||
|
|
||||||
|
echo.
|
||||||
|
|
||||||
PUSHD %~dp0
|
PUSHD %~dp0
|
||||||
call runasadmin.bat "%~dpnx0"
|
call runasadmin.bat "%~dpnx0"
|
||||||
if %errorlevel% == 0 (
|
if %errorlevel% == 0 (
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
@echo off
|
@echo off
|
||||||
PUSHD %~dp0
|
|
||||||
|
echo "##########################################################"
|
||||||
|
echo "######### Start build and deploy #######################"
|
||||||
|
echo "##########################################################"
|
||||||
|
|
||||||
|
echo.
|
||||||
|
|
||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
|
|
||||||
call runasadmin.bat "%~dpnx0"
|
call runasadmin.bat "%~dpnx0"
|
||||||
@ -8,15 +14,15 @@ if %errorlevel% == 0 (
|
|||||||
|
|
||||||
call start\stop.bat nopause
|
call start\stop.bat nopause
|
||||||
|
|
||||||
PUSHD %~dp0..
|
|
||||||
|
|
||||||
echo "FRONT-END static"
|
echo "FRONT-END static"
|
||||||
call build\build.static.bat nopause
|
call build.static.bat nopause
|
||||||
|
|
||||||
echo "BACK-END"
|
echo "BACK-END"
|
||||||
call build\build.backend.bat nopause
|
call build.backend.bat nopause
|
||||||
|
|
||||||
call build\start\start.bat nopause
|
call start\start.bat nopause
|
||||||
|
|
||||||
|
echo.
|
||||||
|
|
||||||
pause
|
pause
|
||||||
)
|
)
|
@ -23,6 +23,5 @@ if '%errorlevel%' NEQ '0' (
|
|||||||
exit /B 1
|
exit /B 1
|
||||||
|
|
||||||
:gotAdmin
|
:gotAdmin
|
||||||
pushd "%CD%"
|
|
||||||
CD /D "%~dp0"
|
CD /D "%~dp0"
|
||||||
:--------------------------------------
|
:--------------------------------------
|
33
build/start/command.ps1
Normal file
33
build/start/command.ps1
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
$PSversionMajor = $PSVersionTable.PSVersion | sort-object major | ForEach-Object {$_.major}
|
||||||
|
$PSversionMinor = $PSVersionTable.PSVersion | sort-object minor | ForEach-Object {$_.minor}
|
||||||
|
|
||||||
|
if ($PSversionMajor -lt 7 -or $PSversionMinor -lt 2) {
|
||||||
|
Write-Error "Powershell version must be greater than or equal to 7.2. Press Enter to exit."
|
||||||
|
Pause
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
$WorkDir = "$(Split-Path -Parent $PSScriptRoot)\run";
|
||||||
|
$CommandName = "$($args[0])";
|
||||||
|
|
||||||
|
#Write-Output "Starting $($CommandName) services at time: $(Get-Date -Format HH:mm:ss)"
|
||||||
|
#Write-Output ""
|
||||||
|
|
||||||
|
Get-ChildItem -Path $WorkDir | ForEach-Object -ThrottleLimit 20 -Parallel {
|
||||||
|
$ServiceName = "Onlyoffice$([System.IO.Path]::GetFileNameWithoutExtension($_))";
|
||||||
|
|
||||||
|
switch ( $Using:CommandName )
|
||||||
|
{
|
||||||
|
"start" { Start-Service -InputObject $(Get-Service -Name "$ServiceName") }
|
||||||
|
"stop" { Stop-Service -InputObject $(Get-Service -Name "$ServiceName") }
|
||||||
|
"restart" { Restart-Service -InputObject $(Get-Service -Name "$ServiceName") }
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $? )
|
||||||
|
{
|
||||||
|
Write-Output "$ServiceName $($Using:CommandName) service has been done"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Write-Output ""
|
||||||
|
#Write-Output "End $($CommandName) services at time: $(Get-Date -Format HH:mm:ss)"
|
@ -3,11 +3,10 @@
|
|||||||
PUSHD %~dp0..
|
PUSHD %~dp0..
|
||||||
call runasadmin.bat "%~dpnx0"
|
call runasadmin.bat "%~dpnx0"
|
||||||
|
|
||||||
|
POPD
|
||||||
|
|
||||||
if %errorlevel% == 0 (
|
if %errorlevel% == 0 (
|
||||||
for /R "run\" %%f in (*.bat) do (
|
pwsh %~dp0/command.ps1 "restart"
|
||||||
call sc stop "Onlyoffice%%~nf"
|
|
||||||
call sc start "Onlyoffice%%~nf"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
PUSHD %~dp0..
|
PUSHD %~dp0..
|
||||||
call runasadmin.bat "%~dpnx0"
|
call runasadmin.bat "%~dpnx0"
|
||||||
|
|
||||||
|
POPD
|
||||||
|
|
||||||
if %errorlevel% == 0 (
|
if %errorlevel% == 0 (
|
||||||
for /R "run\" %%f in (*.bat) do (
|
pwsh %~dp0/command.ps1 "start"
|
||||||
call sc start "Onlyoffice%%~nf"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
PUSHD %~dp0..
|
PUSHD %~dp0..
|
||||||
call runasadmin.bat "%~dpnx0"
|
call runasadmin.bat "%~dpnx0"
|
||||||
|
|
||||||
|
POPD
|
||||||
|
|
||||||
if %errorlevel% == 0 (
|
if %errorlevel% == 0 (
|
||||||
for /R "run\" %%f in (*.bat) do (
|
pwsh %~dp0/command.ps1 "stop"
|
||||||
call sc stop "Onlyoffice%%~nf"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
|
@ -205,7 +205,8 @@ namespace ASC.Files.Core.Security
|
|||||||
|
|
||||||
private IEnumerable<Guid> WhoCan<T>(FileEntry<T> entry, FilesSecurityActions action)
|
private IEnumerable<Guid> WhoCan<T>(FileEntry<T> entry, FilesSecurityActions action)
|
||||||
{
|
{
|
||||||
var shares = GetShares(entry);
|
var copyshares = GetShares(entry);
|
||||||
|
IEnumerable<FileShareRecord> shares = copyshares.ToList();
|
||||||
|
|
||||||
FileShareRecord defaultShareRecord;
|
FileShareRecord defaultShareRecord;
|
||||||
|
|
||||||
@ -318,7 +319,7 @@ namespace ASC.Files.Core.Security
|
|||||||
return new[] { x.Subject };
|
return new[] { x.Subject };
|
||||||
})
|
})
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.Where(x => Can(entry, x, action))
|
.Where(x => Can(entry, x, action, copyshares))
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,9 +343,9 @@ namespace ASC.Files.Core.Security
|
|||||||
return Filter(entries.Cast<FileEntry<T>>(), FilesSecurityActions.Edit, AuthContext.CurrentAccount.ID).Cast<Folder<T>>();
|
return Filter(entries.Cast<FileEntry<T>>(), FilesSecurityActions.Edit, AuthContext.CurrentAccount.ID).Cast<Folder<T>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool Can<T>(FileEntry<T> entry, Guid userId, FilesSecurityActions action)
|
private bool Can<T>(FileEntry<T> entry, Guid userId, FilesSecurityActions action, IEnumerable<FileShareRecord> shares = null)
|
||||||
{
|
{
|
||||||
return Filter(new[] { entry }, action, userId).Any();
|
return Filter(new[] { entry }, action, userId, shares).Any();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Tuple<FileEntry<T>, bool>> Can<T>(IEnumerable<FileEntry<T>> entry, Guid userId, FilesSecurityActions action)
|
private List<Tuple<FileEntry<T>, bool>> Can<T>(IEnumerable<FileEntry<T>> entry, Guid userId, FilesSecurityActions action)
|
||||||
@ -353,7 +354,7 @@ namespace ASC.Files.Core.Security
|
|||||||
return entry.Select(r => new Tuple<FileEntry<T>, bool>(r, filtres.Any(a => a.ID.Equals(r.ID)))).ToList();
|
return entry.Select(r => new Tuple<FileEntry<T>, bool>(r, filtres.Any(a => a.ID.Equals(r.ID)))).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<FileEntry<T>> Filter<T>(IEnumerable<FileEntry<T>> entries, FilesSecurityActions action, Guid userId)
|
private IEnumerable<FileEntry<T>> Filter<T>(IEnumerable<FileEntry<T>> entries, FilesSecurityActions action, Guid userId, IEnumerable<FileShareRecord> shares = null)
|
||||||
{
|
{
|
||||||
if (entries == null || !entries.Any()) return Enumerable.Empty<FileEntry<T>>();
|
if (entries == null || !entries.Any()) return Enumerable.Empty<FileEntry<T>>();
|
||||||
|
|
||||||
@ -383,8 +384,7 @@ namespace ASC.Files.Core.Security
|
|||||||
|
|
||||||
if (entries.Any(filter))
|
if (entries.Any(filter))
|
||||||
{
|
{
|
||||||
var subjects = GetUserSubjects(userId);
|
List<Guid> subjects = null;
|
||||||
List<FileShareRecord> shares = null;
|
|
||||||
foreach (var e in entries.Where(filter))
|
foreach (var e in entries.Where(filter))
|
||||||
{
|
{
|
||||||
if (!AuthManager.GetAccountByID(TenantManager.GetCurrentTenant().TenantId, userId).IsAuthenticated && userId != FileConstant.ShareLinkId)
|
if (!AuthManager.GetAccountByID(TenantManager.GetCurrentTenant().TenantId, userId).IsAuthenticated && userId != FileConstant.ShareLinkId)
|
||||||
@ -516,11 +516,18 @@ namespace ASC.Files.Core.Security
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (subjects == null)
|
||||||
|
{
|
||||||
|
subjects = GetUserSubjects(userId);
|
||||||
if (shares == null)
|
if (shares == null)
|
||||||
{
|
{
|
||||||
shares = GetShares(entries).Join(subjects, r => r.Subject, s => s, (r, s) => r).ToList();
|
shares = GetShares(entries);
|
||||||
// shares ordered by level
|
// shares ordered by level
|
||||||
}
|
}
|
||||||
|
shares = shares
|
||||||
|
.Join(subjects, r => r.Subject, s => s, (r, s) => r)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
FileShareRecord ace;
|
FileShareRecord ace;
|
||||||
if (e.FileEntryType == FileEntryType.File)
|
if (e.FileEntryType == FileEntryType.File)
|
||||||
|
Loading…
Reference in New Issue
Block a user