Link to home
Start Free TrialLog in
Avatar of dba123
dba123

asked on

does not implement interface member 'Microsoft.Practices.EnterpriseLibrary.Security.IAuthorizationProvider.Authorize(System.Security.Principal.IPrincipal, System.Collections.Generic.List<string>)

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:


I
1    namespace Microsoft.Practices.EnterpriseLibrary.Security
2    
3    {
4    
5        /// <summary>
6        /// Abstract implementation of the <see cref="IAuthorizationProvider"/> interface.
7        /// </summary>
8        public abstract class TESTAuthorizationProvider : IAuthorizationProvider
9    
10       {
11  
  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
2        {
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);
11  
12       }
 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?
Avatar of p_davis
p_davis

put your cursor on IAuthorizationProvider and click anywhere in the string.
you should bet a little purplish block under the first letter. if you click on that you should get a dropdown asking how to implement just select the first it the list and it will stub in all code for that interface and should get rid of that error
ASKER CERTIFIED SOLUTION
Avatar of thuannguy
thuannguy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
umm i'm not usually a point grubber but, what the heck! the second post was a reiteration of mine. b/c if you implement the signatures are setup for you.