Esempio n. 1
0
  @DataProvider(name = "generateUserScheduledEditOpsPermission")
  public Object[][] generateUserScheduledEditOpsPermission() {

    final Object[][] allowedCombinations =
        MatrixUtil.crossProduct(
            new String[] {
              MerlinConstants.FALCON_SUPER_USER_NAME,
              MerlinConstants.FALCON_SUPER_USER2_NAME,
              MerlinConstants.USER2_NAME,
            },
            new EntityOp[] {
              EntityOp.delete, EntityOp.update, EntityOp.suspend, EntityOp.resume,
            },
            new Boolean[] {
              true,
            });

    final Object[][] notAllowedCombinations =
        MatrixUtil.crossProduct(
            new String[] {
              MerlinConstants.DIFFERENT_USER_NAME,
            },
            new EntityOp[] {
              EntityOp.delete, EntityOp.update, EntityOp.suspend, EntityOp.resume,
            },
            new Boolean[] {
              false,
            });

    return MatrixUtil.append(allowedCombinations, notAllowedCombinations);
  }
Esempio n. 2
0
  @DataProvider(name = "generateUserReadOpsPermissions")
  public Object[][] generateUserReadOpsPermissions() {
    final EntityOp[] falconReadOps = {
      EntityOp.status, EntityOp.dependency, EntityOp.listing, EntityOp.definition,
    };
    final Object[][] allowedCombinations =
        MatrixUtil.crossProduct(
            new String[] {
              MerlinConstants.FALCON_SUPER_USER_NAME,
              MerlinConstants.FALCON_SUPER_USER2_NAME,
              MerlinConstants.USER2_NAME,
            },
            falconReadOps,
            new Boolean[] {true});

    final Object[][] notAllowedCombinations =
        MatrixUtil.crossProduct(
            new String[] {MerlinConstants.DIFFERENT_USER_NAME},
            falconReadOps,
            new Boolean[] {false});
    return MatrixUtil.append(allowedCombinations, notAllowedCombinations);
  }