Sha256: 51e827e160e6f1bb3fdaa88da8b0f97298f7fe700b53b045e081151e43704cec

Contents?: true

Size: 829 Bytes

Versions: 1

Compression:

Stored size: 829 Bytes

Contents

module Skr

    # Implements the interface for a User model in Stockor
    # This implementation grants access to everything
    class NullUser
        # Used to track created_by and updated_by
        def id
            0
        end
        # @param model [Skr::Model]
        # @param attribute [Symbol]
        # @return [Boolean] Can the User view the model?
        def can_read?( model, attribute=nil)
            true
        end

        # @param model [Skr::Model]
        # @param attribute [Symbol]
        # @return [Boolean] Can the User create and update the model?
        def can_write?(model, attribute=nil)
            true
        end

        # @param model [Skr::Model]
        # @return [Boolean] Can the User delete the model?
        def can_delete?(type, model)
            true
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stockor-core-0.2 lib/skr/null_user.rb