Support » Plugin: User Role Editor » Bug with User Role Editor and Visual Composer

  • Ran into an issue today with using this plugin and Visual Composer. It’s not clear to me if this plugin is causing the issue or if it’s VC.

    I noticed that when I change permissions and/or capabilities for a role using URE then the Role Manager settings in Visual Composer for that role lose settings.

    1) User with “Editor” role has access to Visual Composer
    2) Edit “Editor” Role (any capability) and click Update
    3) Users with “Editor” role suddenly have no access to VC because VC Role Manager settings for that role have been reset to default

    I am filing this bug with the developers of Visual Composer as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Vladimir Garagulia


    Thanks a lot for this information.
    I reproduced the described scenario. I will search a reason and return to you with results.

    Plugin Author Vladimir Garagulia


    WordPress itself writes capabilities to the roles with boolean values only. Roles data is stored at the database in a form of PHP serialized array: like this:

    Tests showed that ‘Visual Composer’ allows itself to add to the role a capability with not boolean, but string value. We can see at serialized data after click ‘Save’ from Visual Composer Roles Manager:


    It corresponds to the “Post Types: Custom” choice at Visual Composer Roles Manager.

    User Role Editor interpretes not empty value as a boolean ‘true’, so we still see ‘vc_access_rules_post_types’ capability turned ON, when we load this role. But when we change it, User Role Editor saves all capabilities as boolean values, as they should be. So after updating role with User Role Editor capability data becomes:
    not s:6:"custom" (string ‘custom’) as it was before, but b:1 (boolean true) as it must be.

    As expected when we open VC Role Manager again it does not see ‘custom’ value for ‘vc_access_rules_post_types’ capability and selects at post types dropdown list the 1st available option ‘Pages Only’.

    I think that plugins should not write to the core WordPress data structures any own data types – only types supposed by WordPress core. Capabilities should be boolean always.
    Thus Visual Composer developers should rewrite this part in order to correspond to WordPress core.

    Hi Vladimir,
    thanks for the explanation but unfortunately the problem is really annoyng.

    When the post option is reset the user lose the ability to use Visual Composer in post types. I’ve posted the same question in the VC Support Forum, meanwhile the changes the way they seave the prefs in the DB could you plan a workaround to avoid resetting Visual Composer prefs?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.