コード例 #1
0
ファイル: FeedAclTest.java プロジェクト: nigel-jones/falcon
  @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);
  }
コード例 #2
0
ファイル: FeedAclTest.java プロジェクト: nigel-jones/falcon
  @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);
  }