Rev 4918 | Blame | Compare with Previous | Last modification | View Log | RSS feed
REM Maintained in package SubversionServerSupportREMREM Limit the property chnages that a user can make to:REM svn:log (commit comment)REM Made by themselves onlyREM On the same dayREM [Now allow change to log made on any day]REMREM Args %1 - Repo PathREM %2 - Rev to be changedREM %3 - Authenticated user nameREM %4 - Name of property to be changedREM %5 - Change Type. A,D or MREM These users can do anythingif %3==xdpurdie goto OKif %3==buildadm goto OKREMREM The rest of this code allows a user to modify his own svn:log (comment) createdREM today. The date test is brute force.REM Allow log comments to be modifiedif NOT %4==svn:log goto BADif NOT %5==M goto BADset SVNLOOK="%VISUALSVN_SERVER%bin\svnlook.exe"REM User can only modify his own commentsset muser=errorfor /f "delims=" %%a in ('%SVNLOOK% author -r %2 %1 ') do @set muser=%%aif NOT %muser%==%3 goto BADUSERREM User is allowed to modify comment [Age not longer considered]goto OKREM User can only modify comments made on the same dayset datestamp=errorset today=errorfor /f "delims=" %%a in ('%SVNLOOK% date -r %2 %1 ') do @set datestamp=%%aset datestamp=%datestamp:~0,10%for /F "tokens=1-4 delims=/ " %%a in ("%date%") do (set YEAR=%%dset MONTH=%%cset DAY=%%b )set today=%YEAR%-%MONTH%-%DAY%if NOT %today%==%datestamp% goto BADDAYREM User is allowed to modify commentgoto OK:BADDAYecho User %3 is only allowed to modify svn:log created on the same day >&2echo Info. Change User: %muser%. Change Date: %datestamp%. Today: %today%. %date% >&2exit 1:BADUSERecho User %3 is not allowed to modify svn:log created by another user (%muser%) on %1 >&2exit 1:BADecho User %3 is not allowed to modify repository properties %4(%5) on %1 >&2exit 1:OKexit 0