@@ -47,7 +47,7 @@ Method UserAction(Type As %Integer, Name As %String, InternalName As %String, Se
47
47
if Type = 1 , Name = 5 {
48
48
// reroute to Status menu option
49
49
set Name = " %SourceMenu,Status"
50
- }
50
+ }
51
51
52
52
#dim ec as %Status = $$$OK
53
53
#dim menu as %Status = $piece (Name , " ," , 1 )
@@ -253,13 +253,21 @@ InternalName'="" && ##class(Utils).IsInSourceControl(##class(Utils).NormalizeInt
253
253
/// Called before an item is deleted.
254
254
Method OnBeforeDelete (InternalName As %String ) As %Status
255
255
{
256
- set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
257
- set InternalName = ##class (Utils ).NormalizeInternalName (InternalName )
258
- set Filename = ##class (Utils ).FullExternalName (InternalName )
259
- if ##class (Utils ).IsInSourceControl (InternalName ) {
260
- quit ##class (Change ).AddDeletedToUncommitted (Filename , InternalName )
256
+ if ..IsReadOnly (InternalName ) {
257
+ set ^mtempVG (" dbg" ,$i (^mtempVG )) = " readonly"
258
+ // throw error if deleting readonly item
259
+ Throw ##class (%Exception.General ).%New (" Can't delete in locked environment" )
260
+ } else {
261
+ set ^mtempVG (" dbg" ,$i (^mtempVG )) = " not readonly"
262
+ set context = ##class (SourceControl.Git.PackageManagerContext ).ForInternalName (InternalName )
263
+ set InternalName = ##class (Utils ).NormalizeInternalName (InternalName )
264
+ set Filename = ##class (Utils ).FullExternalName (InternalName )
265
+ if ##class (Utils ).IsInSourceControl (InternalName ) {
266
+ quit ##class (Change ).AddDeletedToUncommitted (Filename , InternalName )
267
+ }
268
+ quit $$$OK
261
269
}
262
- quit $$$OK
270
+ set ^mtempVG ( " dbg " , $i ( ^mtempVG )) = " outside, after if readonly "
263
271
}
264
272
265
273
/// Called after an item is deleted.
0 commit comments