public int doStartTag() throws JspException {
		if ((null == hasPermission) || "".equals(hasPermission)) {
			return skipBody();
		}

		initializeIfRequired();

		if (domainObject == null) {
			if (logger.isDebugEnabled()) {
				logger.debug("domainObject resolved to null, so including tag body");
			}

			// Of course they have access to a null object!
			return evalBody();
		}

		Authentication authentication = SecurityContextHolder.getContext()
				.getAuthentication();
		if (authentication == null) {
			if (logger.isDebugEnabled()) {
				logger.debug("SecurityContextHolder did not return a non-null Authentication object, so skipping tag body");
			}

			return skipBody();
		}

		List<Object> requiredPermissions = parseHasPermission(hasPermission);
		for (Object requiredPermission : requiredPermissions) {
			if (!permissionEvaluator.hasPermission(authentication, domainObject,
					requiredPermission)) {
				return skipBody();
			}
		}

		return evalBody();
	}