/** * @see org.opencms.security.I_CmsPrincipal#isEnabled() */ public boolean isEnabled() { return (getFlags() & I_CmsPrincipal.FLAG_DISABLED) == 0; }
/** * @see org.opencms.security.I_CmsPrincipal#isEnabled() */ public boolean isEnabled() { return (getFlags() & I_CmsPrincipal.FLAG_DISABLED) == 0; }
/** * Filters out all principals that do not have the given flag set, * but leaving principals with flags less than <code>{@link I_CmsPrincipal#FLAG_CORE_LIMIT}</code> untouched.<p> * * The given parameter list is directly modified, so the returned list is the same object as the input list.<p> * * @param principals a list of <code>{@link CmsPrincipal}</code> objects * @param flag the flag for filtering * * @return the filtered principal list */ public static List filterCoreFlag(List principals, int flag) { Iterator it = principals.iterator(); while (it.hasNext()) { CmsPrincipal p = (CmsPrincipal)it.next(); if ((p.getFlags() > I_CmsPrincipal.FLAG_CORE_LIMIT) && ((p.getFlags() & flag) != flag)) { it.remove(); } } return principals; }
/** * Filters out all principals that do not have the given flag set, * but leaving principals with flags less than <code>{@link I_CmsPrincipal#FLAG_CORE_LIMIT}</code> untouched.<p> * * The given parameter list is directly modified, so the returned list is the same object as the input list.<p> * * @param principals a list of <code>{@link CmsPrincipal}</code> objects * @param flag the flag for filtering * * @return the filtered principal list */ public static List<? extends CmsPrincipal> filterCoreFlag(List<? extends CmsPrincipal> principals, int flag) { Iterator<? extends CmsPrincipal> it = principals.iterator(); while (it.hasNext()) { CmsPrincipal p = it.next(); if ((p.getFlags() > I_CmsPrincipal.FLAG_CORE_LIMIT) && ((p.getFlags() & flag) != flag)) { it.remove(); } } return principals; }
/** * Filters out all principals with flags greater than <code>{@link I_CmsPrincipal#FLAG_CORE_LIMIT}</code>.<p> * * The given parameter list is directly modified, so the returned list is the same object as the input list.<p> * * @param principals a list of <code>{@link CmsPrincipal}</code> objects * * @return the filtered principal list */ public static List filterCore(List principals) { Iterator it = principals.iterator(); while (it.hasNext()) { CmsPrincipal p = (CmsPrincipal)it.next(); if (p.getFlags() > I_CmsPrincipal.FLAG_CORE_LIMIT) { it.remove(); } } return principals; }
/** * Filters out all principals that do not have the given flag set.<p> * * The given parameter list is directly modified, so the returned list is the same object as the input list.<p> * * @param principals the list of <code>{@link CmsPrincipal}</code> objects * @param flag the flag for filtering * * @return the filtered principal list */ public static List<? extends CmsPrincipal> filterFlag(List<? extends CmsPrincipal> principals, int flag) { Iterator<? extends CmsPrincipal> it = principals.iterator(); while (it.hasNext()) { CmsPrincipal p = it.next(); if ((p.getFlags() & flag) != flag) { it.remove(); } } return principals; }
/** * Filters out all principals that do not have the given flag set.<p> * * The given parameter list is directly modified, so the returned list is the same object as the input list.<p> * * @param principals the list of <code>{@link CmsPrincipal}</code> objects * @param flag the flag for filtering * * @return the filtered principal list */ public static List filterFlag(List principals, int flag) { Iterator it = principals.iterator(); while (it.hasNext()) { CmsPrincipal p = (CmsPrincipal)it.next(); if ((p.getFlags() & flag) != flag) { it.remove(); } } return principals; }
/** * @see org.opencms.security.I_CmsPrincipal#setEnabled(boolean) */ public void setEnabled(boolean enabled) { if (enabled != isEnabled()) { // toggle disabled flag if required setFlags(getFlags() ^ I_CmsPrincipal.FLAG_DISABLED); } }
/** * @see org.opencms.security.I_CmsPrincipal#setEnabled(boolean) */ public void setEnabled(boolean enabled) { if (enabled != isEnabled()) { // toggle disabled flag if required setFlags(getFlags() ^ I_CmsPrincipal.FLAG_DISABLED); } }