Check user access via post ID

Discussion in 'Integration' started by bdesigner44, Oct 24, 2012.

  1. bdesigner44

    bdesigner44 New Member

    Joined:
    Sep 22, 2012
    Messages:
    1
    I didn't see anything in the documentation for the WordPress plugin, is there a function in the plugin that goes along the line of:
    has_access($postID, $userID)
    which checks if the passed user ID (or current user) has access to the passed post ID (or current post) - I'm looking at using this inside a WordPress loop, so I don't mind if there are no parameters to explicitly set the desired post or user ID and just use the current value for both, or if there is one that allows those to be manually set for more flexibility if needed would be great also.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Hi,
    Unfortunately there is no such function.
    Plugin gets info about user permissions from aMember session, so:
    1. Currently there is no way to get info about other aMember's users access(except the user who is logged in currently).
    2. There is no way to get access permissions for wordpress user. In fact there could be no user record in wordpress for corresponding aMember's user.

    Can you explain why do you need such function? If you use wordpress loop and set protection settings for post to "Hide post when it is not available" it will be removed from loop automatically.
    If you want to display post titles, set protection action to any redirect setting. Post will not be removed from loop, and you will be able to display it title.

Share This Page