-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Overview
When using the Git source control plugin with a user of limited privileges, the source control menu fails to load with a 5002 Protect Error on the DefaultTemp() method
Reproduce
Create a user with the following roles:
Role | Grant |
---|---|
%DB_<Some namespace> | No |
%Developer | No |
%EnsRole_Administrator | No |
%EnsRole_AlertAdministrator | No |
%EnsRole_AlertOperator | No |
%EnsRole_Developer | No |
%EnsRole_Operator | No |
%EnsRole_PubSubDeveloper | No |
%EnsRole_RegistrySelect | No |
%EnsRole_RulesDeveloper | No |
%EnsRole_TempSQLDict | No |
%EnsRole_WebDeveloper | No |
Potential Fix
ClassMethod DefaultTemp() As %String [ CodeMode = expression ]
{
$Get(@..InstallNamespaceStorage()@("%defaultTemp"), "c:\temp\")
}
ClassMethod MakeError(msg As %String) As %Status [ CodeMode = expression, Private ]
{
$$$ERROR(8012,"Git",msg)
}
ClassMethod TempFolder() As %String
{
set context = ##class(SourceControl.Git.PackageManagerContext).%Get()
if context.IsInGitEnabledPackage {
quit context.Package.Root
}
quit ..DefaultTempFolder()
}
ClassMethod DefaultTempFolder() As %String
{
set temp = "c:\temp\"
Try {
set temp = ..DefaultTemp()
} Catch exception {
// Silent exception
}
quit $get(@..#Storage@("settings","namespaceTemp"),temp_$translate($znspace,"%")_..#Slash)
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working