Membership Provider

M

Morgan

Sorry for cross post, forgot to include aspnet in orinal...

Thanks in advance for any assistance.

I'm in the process of implementing custom RoleProvider & Membership Provider
objects and have run into a snag with the Membership Provider.

It seems many of the MembershipUser properties are read-only. This seems,
well stupid, IMO.

I can override these in a class that inherits from MembershipUser and set
them via parameters in the constructor, but that's a lot of work for what
seems should be read-write properties, especially when implementing a custom
provider for another data store. For example, IsLockedOut is read
only?Shouldn't I be able to write to this property when returning a
MembershipUser for the GetUser method?

My question is, is there any other way to access these read only properties?
Have I missed something obvious?

Thanks again,

Morgan
 
S

Steven Cheng[MSFT]

Hi Morgan,

Welcome to ASPNET newsgroup.
As for the MembershipUser class, yes, it has many properteis defined as
readonly. Based on my understanding, those properties are mainly configured
through administration interfaces(most of such methods are defined in
MembershipProvider class), e.g lock a user when the user created and then
active through updating later(through the
SqlMembershipProvider.UnlockUser()).... And all these information stored in
database should not changed outside by normal client application which use
the membership info.... Client application just need to query these
information through GetUser method(retrieved from backend database
storage).... I think that's the reason the buildin MembershipUser class
marked them as readonly .... Of course, we can override or replace them
to all read/writeable in our custom membership framework....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)






--------------------
| From: "Morgan" <[email protected]>
| Subject: Membership Provider
| Date: Tue, 6 Dec 2005 12:15:29 -0500
| Lines: 25
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#HQKhfo#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 168-215-79-61.gen.twtelecom.net 168.215.79.61
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:363128
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Sorry for cross post, forgot to include aspnet in orinal...
|
| Thanks in advance for any assistance.
|
| I'm in the process of implementing custom RoleProvider & Membership
Provider
| objects and have run into a snag with the Membership Provider.
|
| It seems many of the MembershipUser properties are read-only. This seems,
| well stupid, IMO.
|
| I can override these in a class that inherits from MembershipUser and set
| them via parameters in the constructor, but that's a lot of work for what
| seems should be read-write properties, especially when implementing a
custom
| provider for another data store. For example, IsLockedOut is read
| only?Shouldn't I be able to write to this property when returning a
| MembershipUser for the GetUser method?
|
| My question is, is there any other way to access these read only
properties?
| Have I missed something obvious?
|
| Thanks again,
|
| Morgan
|
|
|
 
M

Morgan

Thanks, Steven.

Steven Cheng said:
Hi Morgan,

Welcome to ASPNET newsgroup.
As for the MembershipUser class, yes, it has many properteis defined as
readonly. Based on my understanding, those properties are mainly
configured
through administration interfaces(most of such methods are defined in
MembershipProvider class), e.g lock a user when the user created and then
active through updating later(through the
SqlMembershipProvider.UnlockUser()).... And all these information stored
in
database should not changed outside by normal client application which use
the membership info.... Client application just need to query these
information through GetUser method(retrieved from backend database
storage).... I think that's the reason the buildin MembershipUser class
marked them as readonly .... Of course, we can override or replace them
to all read/writeable in our custom membership framework....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)






--------------------
| From: "Morgan" <[email protected]>
| Subject: Membership Provider
| Date: Tue, 6 Dec 2005 12:15:29 -0500
| Lines: 25
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#HQKhfo#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 168-215-79-61.gen.twtelecom.net 168.215.79.61
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:363128
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Sorry for cross post, forgot to include aspnet in orinal...
|
| Thanks in advance for any assistance.
|
| I'm in the process of implementing custom RoleProvider & Membership
Provider
| objects and have run into a snag with the Membership Provider.
|
| It seems many of the MembershipUser properties are read-only. This
seems,
| well stupid, IMO.
|
| I can override these in a class that inherits from MembershipUser and
set
| them via parameters in the constructor, but that's a lot of work for
what
| seems should be read-write properties, especially when implementing a
custom
| provider for another data store. For example, IsLockedOut is read
| only?Shouldn't I be able to write to this property when returning a
| MembershipUser for the GetUser method?
|
| My question is, is there any other way to access these read only
properties?
| Have I missed something obvious?
|
| Thanks again,
|
| Morgan
|
|
|
 
S

Steven Cheng[MSFT]

You're welcome Norgan,

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Morgan" <[email protected]>
| References: <#HQKhfo#[email protected]>
<iCpF$Ju#[email protected]>
| Subject: Re: Membership Provider
| Date: Wed, 7 Dec 2005 21:15:20 -0500
| Lines: 89
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <OF#y505#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 12-222-91-80.client.insightbb.com 12.222.91.80
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:363534
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks, Steven.
|
| | > Hi Morgan,
| >
| > Welcome to ASPNET newsgroup.
| > As for the MembershipUser class, yes, it has many properteis defined as
| > readonly. Based on my understanding, those properties are mainly
| > configured
| > through administration interfaces(most of such methods are defined in
| > MembershipProvider class), e.g lock a user when the user created and
then
| > active through updating later(through the
| > SqlMembershipProvider.UnlockUser()).... And all these information
stored
| > in
| > database should not changed outside by normal client application which
use
| > the membership info.... Client application just need to query these
| > information through GetUser method(retrieved from backend database
| > storage).... I think that's the reason the buildin MembershipUser
class
| > marked them as readonly .... Of course, we can override or replace
them
| > to all read/writeable in our custom membership framework....
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| >
| >
| > --------------------
| > | From: "Morgan" <[email protected]>
| > | Subject: Membership Provider
| > | Date: Tue, 6 Dec 2005 12:15:29 -0500
| > | Lines: 25
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | Message-ID: <#HQKhfo#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 168-215-79-61.gen.twtelecom.net 168.215.79.61
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:363128
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Sorry for cross post, forgot to include aspnet in orinal...
| > |
| > | Thanks in advance for any assistance.
| > |
| > | I'm in the process of implementing custom RoleProvider & Membership
| > Provider
| > | objects and have run into a snag with the Membership Provider.
| > |
| > | It seems many of the MembershipUser properties are read-only. This
| > seems,
| > | well stupid, IMO.
| > |
| > | I can override these in a class that inherits from MembershipUser and
| > set
| > | them via parameters in the constructor, but that's a lot of work for
| > what
| > | seems should be read-write properties, especially when implementing a
| > custom
| > | provider for another data store. For example, IsLockedOut is read
| > | only?Shouldn't I be able to write to this property when returning a
| > | MembershipUser for the GetUser method?
| > |
| > | My question is, is there any other way to access these read only
| > properties?
| > | Have I missed something obvious?
| > |
| > | Thanks again,
| > |
| > | Morgan
| > |
| > |
| > |
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top