Class: Skr::NullUser

Inherits:
Object
  • Object
show all
Defined in:
lib/skr/null_user.rb

Overview

Implements the interface for a User model in Stockor This implementation grants access to everything

Instance Method Summary collapse

Instance Method Details

#can_delete?(type, model) ⇒ Boolean

Returns Can the User delete the model?.

Parameters:

Returns:

  • (Boolean)

    Can the User delete the model?



26
27
28
# File 'lib/skr/null_user.rb', line 26

def can_delete?(type, model)
    true
end

#can_read?(model, attribute = nil) ⇒ Boolean

Returns Can the User view the model?.

Parameters:

  • model (Skr::Model)
  • attribute (Symbol) (defaults to: nil)

Returns:

  • (Boolean)

    Can the User view the model?



13
14
15
# File 'lib/skr/null_user.rb', line 13

def can_read?( model, attribute=nil)
    true
end

#can_write?(model, attribute = nil) ⇒ Boolean

Returns Can the User create and update the model?.

Parameters:

  • model (Skr::Model)
  • attribute (Symbol) (defaults to: nil)

Returns:

  • (Boolean)

    Can the User create and update the model?



20
21
22
# File 'lib/skr/null_user.rb', line 20

def can_write?(model, attribute=nil)
    true
end

#idObject

Used to track created_by and updated_by



7
8
9
# File 'lib/skr/null_user.rb', line 7

def id
    0
end