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
Last Modified: 2009-12-16
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
3    {
5        /// <summary>
6        /// Abstract implementation of the <see cref="IAuthorizationProvider"/> interface.
7        /// </summary>
8        public abstract class TESTAuthorizationProvider : IAuthorizationProvider
10       {
  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);
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?
Question by:dba123
    LVL 22

    Expert Comment

    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
    LVL 6

    Accepted Solution

    Yes, you need to implement all methods of the implemented interface. In addition, the signature of the methods must be the same as that of the implemented interface.
    LVL 22

    Expert Comment

    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.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now