Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kris Rudin 3 posts 23 karma points
    Dec 08, 2012 @ 01:20
    Kris Rudin
    0

    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.)

    //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?

    Thanks!

  • Kris Rudin 3 posts 23 karma points
    Dec 10, 2012 @ 21:57
    Kris Rudin
    0

    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??

  • Kris Rudin 3 posts 23 karma points
    Dec 11, 2012 @ 20:56
    Kris Rudin
    0

    I have found the problem! There appears to be a bug in the HasAccces method. I will be submitting a proposed fix.

  • Balvvant 5 posts 25 karma points
    Mar 13, 2014 @ 13:24
    Balvvant
    0

    Hi Kris, How you solved this problem? I am facing similar issues and after trying for two days I could not find any answer.

Please Sign in or register to post replies

Write your reply to:

Draft