Class: Serverkit::Resources::User

Inherits:
Base
  • Object
show all
Defined in:
lib/serverkit/resources/user.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #backend, #check_result, #recheck_result, #recipe

Instance Method Summary collapse

Methods inherited from Base

abstract_class?, #all_errors, attribute, #check_command, #check_command_from_identifier, #get_command_from_identifier, #handlers, #id, #initialize, #notifiable?, #run_apply, #run_check, #successful?, #successful_on_check?, #successful_on_recheck?, #to_a

Constructor Details

This class inherits a constructor from Serverkit::Resources::Base

Instance Method Details

#applyObject

Note:

Override



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/serverkit/resources/user.rb', line 16

def apply
  if has_correct_user?
    update_user_encrypted_password unless has_correct_password?
    update_user_gid unless has_correct_gid?
    update_user_home_directory unless has_correct_home_directory?
     unless 
    update_user_uid unless has_correct_uid?
  else
    add_user
  end
end

#checkObject

Note:

Override



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/serverkit/resources/user.rb', line 29

def check
  case
  when !has_correct_user?
    false
  when !has_correct_gid?
    false
  when !has_correct_home_directory?
    false
  when !has_correct_password?
    false
  when !
    false
  when !has_correct_uid?
    false
  else
    true
  end
end