Closed himanshukodwani closed 1 year ago
Hi @himanshukodwani , you'd need something like
[Advice(Kind.Around)]
public object CheckAccess(...){
//check access here
return null; // if check fails
}
for more advanced scenarios you can take a look here https://github.com/pamidur/aspect-injector/blob/master/samples/UniversalWrapper/UniversalWrapper.cs
Please let me know if it works for you?
What I need is an aspect that will check if the current user has permission to execute the method, if not, then I just want this aspect to prevent the method from being executed without throwing an exception and just returns some default value if required.