Module: Aclatraz::Suspect::InstanceMethods

Defined in:
lib/aclatraz/suspect.rb

Instance Method Summary collapse

Instance Method Details

#acl_suspect?Boolean

:nodoc:

Returns:

  • (Boolean)


146
147
148
# File 'lib/aclatraz/suspect.rb', line 146

def acl_suspect? # :nodoc:
  true
end

#isObject

Port to semantic roles management.

Examples

roles.is.foo!                   # equivalent to `roles.assign(:foo)`
roles.is.foo?                   # => true
roles.is.manager_of!(ClassName) # equivalent to `roles.assign(:manager, ClassName)`
rikes.is.manager_of?(ClassName) # => true


172
173
174
# File 'lib/aclatraz/suspect.rb', line 172

def is
  @acl_is ||= SemanticRoles::Yes.new(self)
end

#is_notObject

Port to semantic roles management.

Examples

roles.is_not.foo!               # equivalent to `roles.delete(:foo)`
roles.is.foo?                   # => false
roles.is_not.foo?               # => true
roles.is.manager_of!(ClassName) # equivalent to `roles.delete(:manager, ClassName)`
roles.is.manager_of?(ClassName) # => flase


185
186
187
# File 'lib/aclatraz/suspect.rb', line 185

def is_not
  @acl_is_not ||= SemanticRoles::Not.new(self)
end

#rolesObject

Allows to manage roles assigned to current object.

Examples

roles.assign(:foo)
roles.has?(:foo) # => true
roles.delete(:foo)
roles.has?(:foo) # => false
roles.assign(:foo, ClassName)
roles.assign(:foo, object)


160
161
162
# File 'lib/aclatraz/suspect.rb', line 160

def roles
  @roles ||= Roles.new(self)
end