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.Enterp riseLibrar y.Security
2
3 {
4
5 /// <summary>
6 /// Abstract implementation of the <see cref="IAuthorizationProvid er"/> interface.
7 /// </summary>
8 public abstract class TESTAuthorizationProvider : IAuthorizationProvider
9
10 {
11
get this error: 'Microsoft.Practices.Enter priseLibra ry.Securit y.Authoriz ationProvi der' does not implement interface member 'Microsoft.Practices.Enter priseLibra ry.Securit y.IAuthori zationProv ider.Autho rize(Syste m.Security .Principal .IPrincipa l, System.Collections.Generic .List<stri ng>)'
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</str ong> if the expression evaluates to true,
9 /// otherwise <strong>false</strong>.</r eturns>
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?
Heres' what I have at the top of my new custom class:
I
1 namespace Microsoft.Practices.Enterp
2
3 {
4
5 /// <summary>
6 /// Abstract implementation of the <see cref="IAuthorizationProvid
7 /// </summary>
8 public abstract class TESTAuthorizationProvider : IAuthorizationProvider
9
10 {
11
get this error: 'Microsoft.Practices.Enter
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</str
9 /// otherwise <strong>false</strong>.</r
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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