Skip to main content
Version: 8.1

Vision - User Management Scripting Functions

This page details the various component and extension functions available for Vision's User Management component.

Component Functions​

This component does not have component functions associated with it.

Extension Functions​

filterUser​

  • Description

    • Called for each user loaded into the management table. Return false to hide this user from the management table. This code is executed in a background thread.
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • User Object user - The user object itself. Call user.get('propertyName') to inpsect. Common properties: 'username',' schedule', 'language', user.getRoles() for a list of rolenames.
  • Return

    • Boolean

filterRole​

  • Description

    • Called for each role loaded into the management table. Return false to hide this role from the management table. This code is executed in a background thread.
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • String role - The role name.
  • Return

    • Boolean

filterSchedule​

  • Description

    • Called for each schedule loaded into the schedule dropdown in the edit user panel. Return false to hide this schedule from the dropdown. This code is executed in a background thread.
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • String schedule - The schedule name.
  • Return

    • Boolean

onCreateUser​

  • Description

    • Called when the add button is pressed in the users table
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • Object saveContext - An object that can be used to reject the add by calling saveContext.rejectSave('reason')
  • Return

    • None

onDeleteUser​

  • Description

    • Called when the delete button is pressed in the users table. This code is executed in the background thread and is called once for each user selected.
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • Object saveContext - An object that can be used to reject the edit by calling saveContext.rejectSave('reason'). If more than one user is rejected, reasons will be concatenated.
    • Object user - The user that is trying to be deleted. Call user.get('propertyName') to inspect. Common properties: 'username', 'schedule', 'language'. Call user.getRoles() for a list of rolenames.
  • Return

    • None

onSaveUser​

  • Description

    • Called when the save button is pressed when adding or editing a user. This code is executed in a background thread.
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • Object saveContext - An object that can be used to reject the edit by calling saveContext.rejectSave('reason').
    • User Object user - The user that is trying to be saved. Call user.get('propertyName') to inspect. Common properties: 'username', 'schedule','language'. Call user.getRoles() for a list of rolenames.
  • Return

    • None

onCreateRole​

  • Description

    • Called when the add button is pressed in the roles table.
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • Object saveContext - An object that can be used to reject the add by calling saveContext.rejectSave('reason')
  • Return

    • None

onDeleteRole​

  • Description

    • Called when the save button is pressed when adding or editing a role. This code is executed in a background thread.
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • Object saveContext - An object that can be used to reject the edit by calling saveContext.rejectSave('reason'). If more than one role is rejected, reasons will be concatenated.
    • String name - The role name that is being deleted.
  • Return

    • None

onSaveRole​

  • Description

    • Called when the save button is pressed when adding or editing a role. This code is executed in a background thread.
  • Parameters

    • Component self - A reference to the component that is invoking this function.
    • Object saveContext - An object that can be used to reject the edit by calling saveContect.rejectSave('reason').
    • String oldName - The role name before editing. Will be None for a role being added.
    • String newName - The new name of the edited role.
  • Return

    • None