Skip to main content
Solved

Prevent approval own documents


Hi Community,

I often am asked as part of the approval process to prevent users from approving their own documents.

This can be done by setting an approval rule that the current employee is not a specific employee ID, but then I am stuck maintaining a list of employees on the approval rules.

I could also find a way to exclude a specific workgroup, but usually an employee has multiple workgroups.

This feels like it should be out of the box approval process.

How do most people handle this situation? 

Best answer by andriitkachenko

Hi @matt hoss 

Never had to restrict users from approving their own records, all the time the assumption was that the Approval Map would be configured in a way that delegates the approval flow to another superior user/group.

It even feels natural - when you want to have a document approved/rejected (for example, a receipt refund for a dinner with a client), you expect the approval to come from your manager - immediate or higher.

If you want tree-like relations - you can make several steps with conditions which are going from bottom to the top of the chain of command.

So my first thought was to say that this is a sign that something is configured incorrectly (or, for some cases - that the general flow of Approval Assignment doesn’t fit your use case).

 

If I had to implement this, I’d look into creating a child class from EPApprovalAutomation - a special class, responsible for adding approval magic into your graph.

It has an Assign method, responsible for searching and assigning approver to the record, based on the associated Approval Map. It uses the DoMapReExecution method to search for assignment rules, while in turn delegates it to the MapReExecutionInternalMapReExecutionInternal is protected, so we can try to override in the child view class and add validation that the approver isn’t the same as the owner.

View original
Did this topic help you find an answer to your question?

3 replies

andriitkachenko
Jr Varsity I
Forum|alt.badge.img+6

Hi @matt hoss 

Never had to restrict users from approving their own records, all the time the assumption was that the Approval Map would be configured in a way that delegates the approval flow to another superior user/group.

It even feels natural - when you want to have a document approved/rejected (for example, a receipt refund for a dinner with a client), you expect the approval to come from your manager - immediate or higher.

If you want tree-like relations - you can make several steps with conditions which are going from bottom to the top of the chain of command.

So my first thought was to say that this is a sign that something is configured incorrectly (or, for some cases - that the general flow of Approval Assignment doesn’t fit your use case).

 

If I had to implement this, I’d look into creating a child class from EPApprovalAutomation - a special class, responsible for adding approval magic into your graph.

It has an Assign method, responsible for searching and assigning approver to the record, based on the associated Approval Map. It uses the DoMapReExecution method to search for assignment rules, while in turn delegates it to the MapReExecutionInternalMapReExecutionInternal is protected, so we can try to override in the child view class and add validation that the approver isn’t the same as the owner.


lbarker
Varsity III
Forum|alt.badge.img+1
  • Varsity III
  • 75 replies
  • July 22, 2024

Sadly this is not standard available as a general rule, so you have to add each person in the approval map as an owner and their approver if that person is the owner.

Other option is to look at a customisation.


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1204 replies
  • July 22, 2024

An alternative is to add an unbound bool field (let say IsOwner) to any DAC you want to perform restriction (i.e. POOrder, ...) that compares the CreatedByID to the Current AccessInfo UserID and if match then true otherwise false and use this field in you Approval Map Condition where is equal to False.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings