does not implement interface member 'Microsoft.Practices.EnterpriseLibrary.Security.IAuthorizationProvider.Authorize(System.Security.Principal.IPrincipal, System.Collections.Generic.List<string>)
Posted on 2007-10-11
Ok, bare with me. I know this is probably syntax basics but I'm still learning the advanced sh**. So, I took this class in the Enterprise Library 3.1 called AuthorizationProvider and created a new one which will be custom for us. I get this error though but not sure how to fix this. It's set to use the IAuthorizationProvider just as the implementation of the original AuthorizationProvider.cs was doing. It is because of my new class's name that I get this error when it's trying to use the IAuthorizationProvider class?
Heres' what I have at the top of my new custom class:
1 namespace Microsoft.Practices.EnterpriseLibrary.Security
5 /// <summary>
6 /// Abstract implementation of the <see cref="IAuthorizationProvider"/> interface.
7 /// </summary>
8 public abstract class TESTAuthorizationProvider : IAuthorizationProvider
get this error: 'Microsoft.Practices.EnterpriseLibrary.Security.AuthorizationProvider' does not implement interface member 'Microsoft.Practices.EnterpriseLibrary.Security.IAuthorizationProvider.Authorize(System.Security.Principal.IPrincipal, System.Collections.Generic.List<string>)'
In the Interface it has the Authorize method defined like so:
1 public interface IAuthorizationProvider
3 /// <summary>
4 /// Evaluates the specified authority against the specified context.
5 /// </summary>
6 /// <param name="principal">Must be an <see cref="IPrincipal"/> object.</param>
7 /// <param name="context">Name of the rule to evaluate.</param>
8 /// <returns><strong>True</strong> if the expression evaluates to true,
9 /// otherwise <strong>false</strong>.</returns>
10 bool Authorize(IPrincipal principal, string context);
and in my new custom class, I want to override and create my own implementation because I will be required a different set of arguments. So in my TESTAuthorizationProvider I have this Authorize method I've defined:
public bool Authorize(IPrincipal principal, List<string> rightsRequested)
...etc. Notice that I'm accepting not a string but a generic list. So do I need to override Authorize method from the interface or something to get rid of this error?