Title: [Plugin: User Access Manager] functions
Last modified: August 19, 2016

---

# [Plugin: User Access Manager] functions

 *  [Dr_jAcKaSS](https://wordpress.org/support/users/dr_jackass/)
 * (@dr_jackass)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/)
 * Hi!
 * Is there any function list of extended functions added by the plugin?
 * I’m making my own navigation, so I would like to check for example to what group
   belongs current user.
 * Best regards!
 * [http://wordpress.org/extend/plugins/user-access-manager/](http://wordpress.org/extend/plugins/user-access-manager/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [gm_alex](https://wordpress.org/support/users/gm_alex/)
 * (@gm_alex)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708275)
 * No I’m sorry but there isn’t yet any function list. But you can look at the source
   code, I have commented all functions. I think you should look at the ‘UamAccessHandler.
   class.php’ file at the ‘class’ folder, there are function like ‘getUserGroupsForObject’
   and you can use it like this.
 *     ```
       global $userAccessManager;
       $uamAccessHandler = $userAccessManager->getAccessHandler();
       $userGroupsForUser = $uamAccessHandler->getUserGroupsForObject('user', $userId);
       ```
   
 *  [intrinicity](https://wordpress.org/support/users/intrinicity/)
 * (@intrinicity)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708613)
 * Hi, Can you show mw how to “link” to these functions? I’ve tried to include the
   UamAccessHandler.class.php file and require_once (apologies, for my PHP ineptitude,
   I normally speak AS3 :).
 * I too, am doing my own navigation (in Flash) and I simply want to use the checkObjectAccess()
   function in a post-getting loop to make sure it’s display is permitted. The plug-
   in works a treat in native WordPress but I can easily bypass it using get_posts()
   in my external php file (it returns all the posts, regardless).
 * Am I going about this the right way?
 * Dave
 *  [sitegefuehl](https://wordpress.org/support/users/sitegefuehl/)
 * (@sitegefuehl)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708635)
 * Hi!
    I have the same question. I need a function for my template, which returns
   the uam group from current user. I tried your solutions, but i doenst work.
 *  Plugin Author [gm_alex](https://wordpress.org/support/users/gm_alex/)
 * (@gm_alex)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708636)
 * Hi,
 * the code works I have tested it. It the UAM plugin is active just add these lines
   of code above. Don’t forget to set a valid user id at `$userId`. require_once
   or other includes are not necessary. A better version of the code is this:
 *     ```
       global $userAccessManager;
   
       if (isset($userAccessManager)) {
           $userId = $user_ID;
           $uamAccessHandler = $userAccessManager->getAccessHandler();
           $userGroupsForUser = $uamAccessHandler->getUserGroupsForObject('user', $userId);
   
           print_r($userGroupsForUser);
       }
       ```
   
 * One more example to get the user groups of the current post:
 *     ```
       global $userAccessManager;
   
       if (isset($userAccessManager)) {
           $postId = $post->ID;
           $uamAccessHandler = $userAccessManager->getAccessHandler();
           $userGroupsForUser = $uamAccessHandler->getUserGroupsForObject('post', $postId);
   
           print_r($userGroupsForUser);
       }
       ```
   
 *  [sitegefuehl](https://wordpress.org/support/users/sitegefuehl/)
 * (@sitegefuehl)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708640)
 * I already found another solution for my problem, but thanks for your answer. 
   I’ll try it if i need it again.
 *  Thread Starter [Dr_jAcKaSS](https://wordpress.org/support/users/dr_jackass/)
 * (@dr_jackass)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708648)
 * GM_Alex: Are you sure this works as you are saying?
 * Because I get out an array of something like all properties and settings for 
   the page instead of an array of usergroups’ IDs.
 * Preview of the first cide:
    array(1) { [1]=> object(UamUserGroup)#144 (13) { [“
   accessHandler:protected”]=> object(UamAccessHandler)#241 (8) { [“userAccessManager:
   protected”]=> object(UserAccessManager)#158 (8) { [“atAdminPanel:protected”]=
   > bool(false) [“adminOptionsName:protected”]=> string(15) “uamAdminOptions” [“
   uamVersion:protected”]=> string(5) “1.1.4” [“uamDbVersion:protected”]=> string(
   3) “1.1” [“adminOptions:protected”]=> array(32) { [“hide_post_title”]=> string(
   5) “false” [“post_title”]=> string(34) “Nimate pravic za dostop do strani!” [“
   post_content”]=> string(47) “Nimate pravic za ogled prispevka! [LOGIN_FORM]” [“
   hide_post”]=> string(5) “false” [“hide_post_comment”]=> string(5) “false” [“post_comment_content”]
   => string(33) “Sorry no rights to view comments!” [“post_comments_locked”]=> 
   string(5) “false” [“hide_page_title”]=> string(5)
 *  Thread Starter [Dr_jAcKaSS](https://wordpress.org/support/users/dr_jackass/)
 * (@dr_jackass)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708649)
 *  Thread Starter [Dr_jAcKaSS](https://wordpress.org/support/users/dr_jackass/)
 * (@dr_jackass)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708650)
 * problems with computer, just delete
 *  Thread Starter [Dr_jAcKaSS](https://wordpress.org/support/users/dr_jackass/)
 * (@dr_jackass)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708651)
 * Ok, just ignore the previous post, it was very stupid from me.
 * I have figured it out.
 * code:
 *     ```
       global $userAccessManager;
   
       if (isset($userAccessManager)) {
           $userId = $user_ID;
           $uamAccessHandler = $userAccessManager->getAccessHandler();
           $userGroupsForUser = $uamAccessHandler->getUserGroupsForObject('user', $userId);
   
           foreach($userGroupsForUser as $element){
                print $element->getId();
           }
       }
       ```
   
 *  [davoron](https://wordpress.org/support/users/davoron/)
 * (@davoron)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708665)
 * Hi GM_ALEX.
 * I tried to get the access Group of a specific pages but I don’t get proper responses
   from your uamAccessHandler.
    I read you plugin code and tried to debug by myself
   but cant get a step forward.
 * I am on a Page and try to find out if the subpages are restricted or not.
    All
   I got back is a empty array.
 * As far as I found out, my page_id is no in the subarray of objectUserGroups[$
   objectType][$filterAttr] by these time.
 * To make thinks short:
    It would be cool if I could get a complete array of all
   Pages and Users and their group-ids without asking the Database by myself. To
   do so by myself is no problem for me but I think it could be unnecessary if you
   class have the Data already in it. Or does it not have?
 * By the way you plugin runs like a charm and expect of the lack of comments your
   sourcecode is very good to read and I learned some thinks by do so! Thank you
   for the good work! Donations will follow! 🙂
 * Davoron
 *  [jynk](https://wordpress.org/support/users/jynk/)
 * (@jynk)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708733)
 * found a short way of checking if the current user can access a page etc;
 * [added to functions.php]
 * function uamHasAccess($userID){
 *  global $userAccessManager;
    $uamAccessHandler = $userAccessManager->getAccessHandler();
   return $uamHasAccess = $uamAccessHandler->checkUserAccess();
 *  }

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘[Plugin: User Access Manager] functions’ is closed to new replies.

 * ![](https://ps.w.org/user-access-manager/assets/icon.svg?rev=1563783)
 * [User Access Manager](https://wordpress.org/plugins/user-access-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-access-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-access-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/user-access-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-access-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-access-manager/reviews/)

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)

 * 11 replies
 * 6 participants
 * Last reply from: [jynk](https://wordpress.org/support/users/jynk/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-functions/#post-1708733)
 * Status: not resolved