public void checkRole(CmsRequestContext context, CmsRole role) throws CmsRoleViolationException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        try {
            checkRole(dbc, role);
        } finally {
            dbc.clear();
        }
    }
public void checkRole ( CmsRequestContext context , CmsRole role ) throws CmsRoleViolationException { CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { checkRole ( dbc , role ) ; } finally { dbc . clear ( ) ; } }
Checks if the user of the current context has permissions to impersonate the given role.<p>

If the organizational unit is <code>null</code>, this method will check if the
given user has the given role for at least one organizational unit.<p>

@param context the current request context
@param role the role to check

@throws CmsRoleViolationException if the user does not have the required role permissions