code: public CmsRoleViolationException createRoleViolationExceptionForResource(
          CmsRequestContext requestContext,
          CmsResource resource) {
  
          return new CmsRoleViolationException(
              Messages.get().container(
                  Messages.ERR_USER_NOT_IN_ROLE_FOR_RESOURCE_3,
                  requestContext.getCurrentUser().getName(),
                  getName(requestContext.getLocale()),
                  requestContext.removeSiteRoot(resource.getRootPath())));
      }
docs: Returns a role violation exception configured with a localized, role specific message
  for this role.<p>
  
  @param requestContext the current users OpenCms request context
  @param resource the resource used for the role check, it may be <code>null</code>
  
  @return a role violation exception configured with a localized, role specific message
  for this role