| Author |
Message |
Eason
Guest
|
Posted:
Thu Oct 20, 2005 8:51 pm Post subject:
SPList.DoesUserHavePermissions problem |
|
|
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 |
|
|
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
|
|
| Back to top |
|
 |
Eason
Guest
|
Posted:
Tue Oct 25, 2005 5:50 am Post subject:
RE: SPList.DoesUserHavePermissions problem |
|
|
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 |
|
 |
|
|
|
|