Skip to content

PermissionManager crashes after receiving OnPermissionsChange #422

@renonick87

Description

@renonick87

Bug Report

When the JavaScript Suite receives an OnPermissionsChange notification from core, the PermissionManager will clone the old unchanged permissions but does not convert them to the correct PermissionItem class. The manager may later try to call getHmiPermissions on these old permission items but this fails because the old items are Objects and not instances of the PermissionItem class.

Reproduction Steps
  1. Connect a JavaScript Suite app to core.
  2. Trigger a PTU that updates the permissions for an RPC for which the app has access.
  3. Call PermissionManager.isRpcAllowed for the RPC to check the updated permissions.
Expected Behavior

The manager should return a boolean value denoting whether the RPC is allowed or not.

Observed Behavior

The manager crashes because it is trying to call an RPCStruct method on a plain JavaScript Object.

Browser & Version Information
  • SDL JavaScript Suite Module: node.
  • SDL JavaScript Version: The most recent commit to the release/1.3.0_RC branch.
  • Testing Against: The most recent commit to the sdl_core release/7.1.0-RC branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions