Module: StoreAgent::Node::PermissionChecker

Defined in:
lib/store_agent/node/prepend_module/permission_checker.rb

Overview

オブジェクトの操作時に権限があるかどうかをチェックするモジュール

Instance Method Summary collapse

Instance Method Details

#chownObject



72
73
74
75
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 72

def chown(*)
  authorize!("chown")
  super
end

#copy(dest_path = nil) ⇒ Object

TODO コピー先のwrite権限をチェックする



50
51
52
53
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 50

def copy(dest_path = nil, *)
  authorize!("read")
  super
end

#createObject



21
22
23
24
25
26
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 21

def create(*)
  if !root?
    parent_directory.authorize!("write")
  end
  super
end

#deleteObject



38
39
40
41
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 38

def delete(*)
  authorize!("write")
  super
end

#get_metadataObject

:nodoc:



62
63
64
65
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 62

def (*) # :nodoc:
  authorize!("read")
  super
end

#get_permissionsObject

:nodoc:



67
68
69
70
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 67

def get_permissions(*) # :nodoc:
  authorize!("read")
  super
end

#move(dest_path = nil) ⇒ Object

TODO コピー先のwrite権限をチェックする



57
58
59
60
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 57

def move(dest_path = nil, *)
  authorize!("write")
  super
end

#readObject



28
29
30
31
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 28

def read(*)
  authorize!("read")
  super
end

#set_permissionObject



77
78
79
80
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 77

def set_permission(*)
  authorize!("chmod")
  super
end

#touchObject



43
44
45
46
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 43

def touch(*)
  authorize!("read")
  super
end

#unset_permissionObject



82
83
84
85
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 82

def unset_permission(*)
  authorize!("chmod")
  super
end

#updateObject



33
34
35
36
# File 'lib/store_agent/node/prepend_module/permission_checker.rb', line 33

def update(*)
  authorize!("write")
  super
end