I have a document in the document library, that is restricted (via public access interface) to a particular role. When I am checking programmatically to see if a user has access to the document, it comes back true, even though the user is not in that role. (This is not the current user - I'm checking a list of users.)
//get user
username = System.Web.Security.Membership.GetUserNameByEmail(userEmail);
user = Membership.GetUser(username, false);
//check access
if (Access.HasAccces(Convert.ToInt32(i.ID), user.ProviderUserKey))
The i.ID is a valid document id value, passed in to the method.
I've verified that the node in question is restricted to role X and the user in question is a member of role Y. But the 'if' statement keeps coming up true. Am I mis-interpreting how the HasAccess method works?
Access.HasAccess not working as expected?
I have a document in the document library, that is restricted (via public access interface) to a particular role. When I am checking programmatically to see if a user has access to the document, it comes back true, even though the user is not in that role. (This is not the current user - I'm checking a list of users.)
The i.ID is a valid document id value, passed in to the method.
I've verified that the node in question is restricted to role X and the user in question is a member of role Y. But the 'if' statement keeps coming up true. Am I mis-interpreting how the HasAccess method works?
Thanks!
Note that the method in question is actually 'HasAccces' - 3 c's and one s.
There is a 'HasAccess' method (spelled correctly), but it is obsolete, and the project won't compile if I try to use it. (I'm using version 4.7.1.1)
Can anyone help me with this? Why doesn't this method work??
I have found the problem! There appears to be a bug in the HasAccces method. I will be submitting a proposed fix.
Hi Kris, How you solved this problem? I am facing similar issues and after trying for two days I could not find any answer.
is working on a reply...