Class: LibACL::Permset
- Inherits:
-
NiceFFI::OpaqueStruct
- Object
- NiceFFI::OpaqueStruct
- LibACL::Permset
- Defined in:
- lib/libacl.rb
Constant Summary collapse
- @@perm_t =
LibACL::find_type(:acl_perm)
Instance Method Summary collapse
- #==(other) ⇒ Object
- #add(perm) ⇒ Object
- #clear ⇒ Object
- #delete(perm) ⇒ Object
- #execute? ⇒ Boolean
- #is_set?(perm) ⇒ Boolean
- #read? ⇒ Boolean
-
#to_i ⇒ Object
a linux hack/shortcut.
- #to_s ⇒ Object
- #write? ⇒ Boolean
Instance Method Details
#==(other) ⇒ Object
263 264 265 |
# File 'lib/libacl.rb', line 263 def == (other) to_i == other.to_i end |
#add(perm) ⇒ Object
246 247 248 |
# File 'lib/libacl.rb', line 246 def add(perm) LibACL::acl_add_perm(self,@@perm_t[perm]) end |
#clear ⇒ Object
242 243 244 |
# File 'lib/libacl.rb', line 242 def clear LibACL::acl_clear_perms(self) end |
#delete(perm) ⇒ Object
250 251 252 |
# File 'lib/libacl.rb', line 250 def delete(perm) LibACL::acl_delete_perm(self,@@perm_t[perm]) end |
#execute? ⇒ Boolean
276 277 278 |
# File 'lib/libacl.rb', line 276 def execute? is_set? :execute end |
#is_set?(perm) ⇒ Boolean
254 255 256 |
# File 'lib/libacl.rb', line 254 def is_set?(perm) LibACL::acl_get_perm(self, @@perm_t[perm]) >0 end |
#read? ⇒ Boolean
268 269 270 |
# File 'lib/libacl.rb', line 268 def read? is_set? :read end |
#to_i ⇒ Object
a linux hack/shortcut
259 260 261 |
# File 'lib/libacl.rb', line 259 def to_i pointer.read_int end |
#to_s ⇒ Object
280 281 282 283 284 285 286 |
# File 'lib/libacl.rb', line 280 def to_s ret="" read? ? ret << "r" : ret << "-" write? ? ret << "w" : ret << "-" execute? ? ret << "x" : ret << "-" ret end |
#write? ⇒ Boolean
272 273 274 |
# File 'lib/libacl.rb', line 272 def write? is_set? :write end |