I am working on a code review. We have code that looks similar to this:
public int MyMethod(Message message)
{
// Check that the user has the access to the function
CheckUserHasAccessToFunction(UserName, FunctionName);
// Do the work
}
What I am wondering is: Is it possible to find all methods where the "CheckUserHasAccessToFunction" is missing. For example using regular expressions.
Which function name we test against will vary from method to method. The mapping between the function name and the method is part of the business logic, which we have implemented in code.