package org.apache.shiro.web.faces.tags;

import com.sun.facelets.tag.TagConfig;

/**
 * @author Deluan Quintao
 */
public class LacksRoleTag extends PermissionTagHandler {

    // TODO - complete JavaDoc

    public LacksRoleTag(TagConfig config) {
        super(config);
    }

    @Override
    protected boolean showTagBody(String roleName) {
        return getSubject() != null && getSubject().hasRole(roleName);
    }

}
package org.apache.shiro.web.faces.tags;

import com.sun.facelets.tag.TagConfig;

/**
 * @author Deluan Quintao
 */
public class LacksRoleTag extends PermissionTagHandler {

    // TODO - complete JavaDoc

    public LacksRoleTag(TagConfig config) {
        super(config);
    }

    @Override
    protected boolean showTagBody(String roleName) {
        boolean hasRole = getSubject() != null && getSubject().hasRole(roleName);
        return !hasRole;
    }

}
tag <shiro:lacksRole> was behaving exactly as <shiro:hasRole>