User Extensions Issue for custom roles

I’ve added custom roles by and have added privileges under these roles. Most of the privilege in the roles decide what apps are accessible to a user (App:_________). In my knowledge these privileges determine the apps visible and accessible to the logged-in user(user extensions).

The problem: Every time I restart the server and log-in as user (User A) having one or more of the above custom roles, some of the apps don’t show up and I’m forced to use a trick/hack that kind of solves the problem
Hack: I simply go to system administration as Super User and navigate to each roles and save them without making any changes to privilege list and try to re-login as the same user that I earlier did (User A) and now I can see all the apps that weren’t visible earlier

What could be the possible reason for such behavior of application? The problem is difficult to track down as it doesn’t have any trace in logs.

Note: I’m using the OpenMRS Platform 1.11.5, Referenceapplication 2.3 and the bundled modules that came along RA 2.3.

Is this in the new or old UI?

@wyclif, I’m using the roles and privilege management functions from old UI by navigating System Administration -> Advance Administration from Reference Application

Make sure that you added your custom privileges to your module’s config.xml file?

@wyclif, I’ve added the custom roles(formed of existing openmrs privileges) just below demo roles defined in RolePrivilegeMetadata.java defined in referencemetadata module.

Now, I’ve seen app privileges added to config.xml files of several modules, but I’m not sure of adding roles to config.xml.

Only privileges get added to config.xml and not roles