mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
f3002931f4
* added errors in plugin list. * added error to details page. * adding badge on details page. * added some more tests. * Renamed to disabled and will handle the scenario in the plugin catalog. * Update public/app/features/plugins/admin/components/PluginDetailsDisabledError.tsx Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * fixing some nits * added missing isDisabeld to the mock. * adding tests to verify scenarios when plugin is disabled. * fixed issue with formatting after file changed on GH. Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
22 lines
382 B
Go
22 lines
382 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package process
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/user"
|
|
)
|
|
|
|
func elevatedPrivilegesCheck() (bool, error) {
|
|
u, err := user.Current()
|
|
if err != nil {
|
|
return false, fmt.Errorf("could not get current OS user to detect process privileges")
|
|
}
|
|
|
|
return (u != nil && u.Username == "root") ||
|
|
os.Geteuid() != os.Getuid() ||
|
|
os.Geteuid() == 0, nil
|
|
}
|