SPList.DoesUserHavePermissions problem
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
SPList.DoesUserHavePermissions problem

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
Eason
Guest





Posted: Thu Oct 20, 2005 8:51 pm    Post subject: SPList.DoesUserHavePermissions problem Reply with quote

I wrote a webpart and it need check if the current user has the right to some
lists.
When I call SPList.DoesUserHavePermissions, for the user who does not have
the permission, it should return false, but it gives an exception. And the IE
browser pops up a dialog box and ask the user to type in new username and
password. I do not want the dialog box and want me to handle the exception.
Even my code catchs the exception, the IE browser still pops up the dialog
box.
Can anyone help?

Thanks

Eason
Back to top
Julien Lepine
Guest





Posted: Fri Oct 21, 2005 12:51 pm    Post subject: RE: SPList.DoesUserHavePermissions problem Reply with quote

Are you in SPS or WSS ?

DoesUserHavePermissions only works in WSS, not SPS.

Answers are in the post.


--
Julien Lepine / ALSY
Software Engineer and Consultant


"Eason" wrote:

Quote:
I wrote a webpart and it need check if the current user has the right to some
lists.
When I call SPList.DoesUserHavePermissions, for the user who does not have
the permission, it should return false, but it gives an exception.

This is a known issue, linked to the answer to your next question.

Quote:
And the IE
browser pops up a dialog box and ask the user to type in new username and
password.

The problem happens with your SPSite object from which you get the web, then
the list, there is a property called CatchAccessDeniedException, you should
set it to false, then make your call, end the popup will not show up.

This is a standard WSS feature, and will happen everytime you try to access
a resource to which the current user does not have access.

Quote:
I do not want the dialog box and want me to handle the exception.
Even my code catchs the exception, the IE browser still pops up the dialog
box.
Can anyone help?


A good article :
http://blogs.msdn.com/ryanrogers/archive/2004/07/15/184594.aspx

Quote:
Thanks

Eason
Back to top
Eason
Guest





Posted: Tue Oct 25, 2005 5:50 am    Post subject: RE: SPList.DoesUserHavePermissions problem Reply with quote

It is exactly what I want to know. I remembered I saw this somewhere before,
but could not find it. Thanks a lot for your help.

Eason

"Julien Lepine" wrote:

Quote:
Are you in SPS or WSS ?

DoesUserHavePermissions only works in WSS, not SPS.

Answers are in the post.


--
Julien Lepine / ALSY
Software Engineer and Consultant


"Eason" wrote:

I wrote a webpart and it need check if the current user has the right to some
lists.
When I call SPList.DoesUserHavePermissions, for the user who does not have
the permission, it should return false, but it gives an exception.

This is a known issue, linked to the answer to your next question.

And the IE
browser pops up a dialog box and ask the user to type in new username and
password.

The problem happens with your SPSite object from which you get the web, then
the list, there is a property called CatchAccessDeniedException, you should
set it to false, then make your call, end the popup will not show up.

This is a standard WSS feature, and will happen everytime you try to access
a resource to which the current user does not have access.

I do not want the dialog box and want me to handle the exception.
Even my code catchs the exception, the IE browser still pops up the dialog
box.
Can anyone help?


A good article :
http://blogs.msdn.com/ryanrogers/archive/2004/07/15/184594.aspx

Thanks

Eason
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB