Module: Yast::SecurityLevelsInclude

Defined in:
../../src/include/security/levels.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) initialize_security_levels(include_target)



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File '../../src/include/security/levels.rb', line 47

def initialize_security_levels(include_target)
  textdomain "security"
  Yast.import "Directory"

  # Level names definitions
  @LevelsNames = {
    # level name
    "Level1" => _("Workstation"),
    # level name
    "Level2" => _("Roaming Device"),
    # level name
    "Level3" => _("Network Server")
  }

  @LevelsLabels = {
    # RadioButton label
    "Level1" => _("&Workstation"),
    # RadioButton label
    "Level2" => _("&Roaming Device"),
    # RadioButton label
    "Level3" => _("Network &Server")
  }

  # Levels definitions
  @Levels = @LevelsNames.keys.each_with_object({}) do |level, levels|
    lfile = Directory.find_data_file("security/#{level.downcase}.yml")
    raise(Errno::ENOENT, "#{level.downcase}.yml file not found") unless lfile
    levels[level] = YAML.load_file(lfile)
  end

  # EOF
end