Class: RivetCms::AccessCheck

Inherits:
Struct
  • Object
show all
Defined in:
lib/rivet_cms/access_check.rb

Overview

Immutable description of one authorization check, passed to RivetCms.can. Checks run in two phases: first with record nil, before anything loads ("is this action available to the user at all", also drives the sidebar), then again with record set to the loaded entry, content type, field, component, media asset, or API token. Fields may be ADDED in minor releases; policies should read only the fields they need and treat unknown action/resource symbols as deny, since the vocabulary grows.

Instance Attribute Summary collapse

Instance Attribute Details

#actionObject

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



9
10
11
# File 'lib/rivet_cms/access_check.rb', line 9

def action
  @action
end

#organizationObject

Returns the value of attribute organization

Returns:

  • (Object)

    the current value of organization



9
10
11
# File 'lib/rivet_cms/access_check.rb', line 9

def organization
  @organization
end

#recordObject

Returns the value of attribute record

Returns:

  • (Object)

    the current value of record



9
10
11
# File 'lib/rivet_cms/access_check.rb', line 9

def record
  @record
end

#resourceObject

Returns the value of attribute resource

Returns:

  • (Object)

    the current value of resource



9
10
11
# File 'lib/rivet_cms/access_check.rb', line 9

def resource
  @resource
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



9
10
11
# File 'lib/rivet_cms/access_check.rb', line 9

def user
  @user
end