For a new project, i need to use Advanced Access Manager (http://wpaam.com/, https://wordpress.org/plugins/advanced-access-manager/) to add custom user roles to wordpress, as well as User Access Manager(http://www.gm-alex.de/projects/wordpress/plugins/user-access-manager, https://wordpress.org/plugins/user-access-manager/), which gives me the option to restrict access to pages/posts to specific user roles.
I couldn’t get it to work, until i noticed that AAM saved the custom roles as something like „aamrole_542a55374728e“, while UAM saved the role a post was restricted to only with the first 11 letters, so like „aamrole_542“. Looking into the database, i found that UAM creates a new datatable which stores the relations of objects like user roles and the access they get, but the object_id field is only 11 characters big. So the user roles created by AAM couldn’t be saved correctly, resulting in denying access where access should have been possible.
To solve this problem, you open your WordPress Database with a tool like phpMyAdmin, navigate to the table wp_uam_accessgroup_to_object, and change the field ‚object_id‘ to be bigger, like 50 characters. Again, if you don’t know what you are doing, DON’T DO IT!
To Alexander, the guy who wrote the plugin: Please change line 225 in the file UserAccessManager.class.php from
object_id VARCHAR(11) NOT NULL,
object_id VARCHAR(50) NOT NULL,
that will make things easier ^^