Prevent specific value in Authorizer

Posts   
 
    
Posts: 67
Joined: 10-Jun-2009
# Posted on: 02-Feb-2012 11:09:32   

In my LLBLGen project (LLBLGen 3.1, Dataadapter) there is an entity which has a field state.

Users with a specific role can only change the state into one specific state:

  • Role A users can only set the state to state X
  • Role B users can only set the state to state Y
  • Role C users can only set the state to state ZCan I make sure this happens right using an Authoriser class on the entity? I have tried to override the CanSetFieldValue function, but it looks like I don't have a reference to the new value of the state.
Posts: 67
Joined: 10-Jun-2009
# Posted on: 02-Feb-2012 12:18:31   

Never mind, I haven't looked into the docs enough. Just use a Validator and I'm done...

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Feb-2012 12:31:28   

This would better be handled by a Validator.

Check these: ValidateEntityFieldSet ValidateEntityBeforeSave