How to check for a set of paramaters

Hello,

I’m writing a provider. I have two parameters:

  • role: Admin/User
  • perms: a list of permissions

Considering that the Admin has a full access, how can I properly check that if the role is “User”, perms has to be set and non empty ?

I can do the check in the create function and throw an error, but then If I set as admin first and update the resource to user, it’s not checked.

ValidateFunc just take the parameter’s value, how can I cross check the value of the perms param from the role ?

Thank you
Jerome

The only way to achieve this at this time is to do the validation logic in the Create and Update functions or to use CustomizeDiff.

Thank you for the rapid answer