2019-03-13 04:14:30 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
type root struct {
|
2021-11-26 01:37:33 -08:00
|
|
|
props properties
|
2019-03-13 04:14:30 -07:00
|
|
|
env environmentInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
2020-11-12 00:43:32 -08:00
|
|
|
// RootIcon indicates the root user
|
2019-03-13 04:14:30 -07:00
|
|
|
RootIcon Property = "root_icon"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (rt *root) enabled() bool {
|
|
|
|
return rt.env.isRunningAsRoot()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (rt *root) string() string {
|
2020-10-15 23:48:49 -07:00
|
|
|
return rt.props.getString(RootIcon, "\uF0E7")
|
2019-03-13 04:14:30 -07:00
|
|
|
}
|
|
|
|
|
2021-11-26 01:37:33 -08:00
|
|
|
func (rt *root) init(props properties, env environmentInfo) {
|
2019-03-13 04:14:30 -07:00
|
|
|
rt.props = props
|
|
|
|
rt.env = env
|
|
|
|
}
|