Freeside:1.9:Documentation:Developer:Agent-virtualized Config

From Freeside
Jump to: navigation, search


Quick notes on how to agent-virtualize a new aspect of the config (typically part_* tables), written up when agent-virtualizing package definitions (part_pkg).

  • Add agentnum to the table.

Add access rights:

  • "Edit NNN"
  • "Edit global NNN"

Edit the (or whatever) module itself.


  • Move to new browse template if necessary
  • Add to options:
    • agent_virt => 1,
    • agent_null_right => "Edit global NNN"
    • agent_pos => whatever works on the page
  • fix "access deined" check:

   die "access denied"
     unless $FS::CurrentUser::CurrentUser->access_right('Edit NNN')
     || $FS::CurrentUser::CurrentUser->access_right('Edit global NNN')

  • Agent-virtualize count_query
     'null_right' => 'Edit global NN',
  • If the query param is a normal qsearch hashref (which it probably is if the page already uses elements/browse, or should be if its being moved to elements/broswe), it will agent-virtualize itself from the agent_virt/agent_null_right/agent_pos options.

The hard part

Find all other places this part of the configuration is used (elements/select-part_TABLE, elements/tr-select-part_TABLE?) and agent-virtualize them too.