/** * Returns <code>true</code> if this is an exclusive (or temporary exclusive) lock, * and the given user is the owner of this lock.<p> * * @param user the user to compare to the owner of this lock * * @return <code>true</code> if this is an exclusive (or temporary exclusive) lock, * and the given user is the owner of this lock */ public boolean isExclusiveOwnedBy(CmsUser user) { return isExclusive() && isOwnedBy(user); }
/** * Returns <code>true</code> if this is an exclusive (or temporary exclusive) lock, * and the given user is the owner and the given project is the project of this lock.<p> * * @param user the user to compare to the owner of this lock * @param project the project to compare to the project of this lock * * @return <code>true</code> if this is an exclusive (or temporary exclusive) lock, * and the given user is the owner and the given project is the project of this lock */ public boolean isExclusiveOwnedInProjectBy(CmsUser user, CmsProject project) { return isExclusive() && isOwnedInProjectBy(user, project); }
/** * Returns <code>true</code> if this is an exclusive (or temporary exclusive) lock, * and the given user is the owner of this lock.<p> * * @param user the user to compare to the owner of this lock * * @return <code>true</code> if this is an exclusive (or temporary exclusive) lock, * and the given user is the owner of this lock */ public boolean isExclusiveOwnedBy(CmsUser user) { return isExclusive() && isOwnedBy(user); }
/** * Returns <code>true</code> if this is an exclusive (or temporary exclusive) lock, * and the given user is the owner and the given project is the project of this lock.<p> * * @param user the user to compare to the owner of this lock * @param project the project to compare to the project of this lock * * @return <code>true</code> if this is an exclusive (or temporary exclusive) lock, * and the given user is the owner and the given project is the project of this lock */ public boolean isExclusiveOwnedInProjectBy(CmsUser user, CmsProject project) { return isExclusive() && isOwnedInProjectBy(user, project); }
/** * Returns <code>true</code> if this is an exclusive, temporary exclusive, or * directly inherited lock, and the given user is the owner of this lock.<p> * * @param user the user to compare to the owner of this lock * * @return <code>true</code> if this is an exclusive, temporary exclusive, or * directly inherited lock, and the given user is the owner of this lock */ public boolean isDirectlyOwnedBy(CmsUser user) { return (isExclusive() || isDirectlyInherited()) && isOwnedBy(user); }
/** * Returns <code>true</code> if this is an exclusive, temporary exclusive, or * directly inherited lock, and the given user is the owner of this lock, * checking also the project of the lock.<p> * * @param user the user to compare to the owner of this lock * @param project the project to compare to the project of this lock * * @return <code>true</code> if this is an exclusive, temporary exclusive, or * directly inherited lock, and the given user is the owner of this lock */ public boolean isDirectlyOwnedInProjectBy(CmsUser user, CmsProject project) { return (isExclusive() || isDirectlyInherited()) && isOwnedInProjectBy(user, project); }
CmsLock lock = getCms().getLock(newRes); if (!lock.isExclusive()) { editProps = false;
/** * Returns <code>true</code> if this is an exclusive, temporary exclusive, or * directly inherited lock, and the current user is the owner of this lock, * checking also the project of the lock.<p> * * @param cms the CMS context to check * * @return <code>true</code> if this is an exclusive, temporary exclusive, or * directly inherited lock, and the current user is the owner of this lock */ public boolean isDirectlyOwnedInProjectBy(CmsObject cms) { return (isExclusive() || isDirectlyInherited()) && isOwnedInProjectBy( cms.getRequestContext().getCurrentUser(), cms.getRequestContext().getCurrentProject()); }
/** * Checks if the current resource has lock state exclusive or inherited.<p> * * This is used to determine whether the dialog shows the option to delete all * siblings of the resource or not. * * @return true if lock state is exclusive or inherited, otherwise false */ public boolean hasCorrectLockstate() { org.opencms.lock.CmsLock lock = null; try { // get the lock state for the current resource lock = getCms().getLock(getParamResource()); } catch (CmsException e) { // error getting lock state, log the error and return false LOG.error(e.getLocalizedMessage(getLocale()), e); return false; } // check if auto lock feature is enabled boolean autoLockFeature = lock.isNullLock() && OpenCms.getWorkplaceManager().autoLockResources(); return autoLockFeature || lock.isExclusive() || lock.isInherited(); }
/** * Checks if the current resource has lock state exclusive or inherited.<p> * * This is used to determine whether the dialog shows the option to delete all * siblings of the resource or not. * * @return true if lock state is exclusive or inherited, otherwise false */ public boolean hasCorrectLockstate() { org.opencms.lock.CmsLock lock = null; try { // get the lock state for the current resource lock = getCms().getLock(getParamResource()); } catch (CmsException e) { // error getting lock state, log the error and return false LOG.error(e.getLocalizedMessage(getLocale()), e); return false; } // check if auto lock feature is enabled boolean autoLockFeature = lock.isNullLock() && OpenCms.getWorkplaceManager().autoLockResources(); return autoLockFeature || lock.isExclusive() || lock.isInherited(); }
/** * Enumeration class for the mode parameter in the * {@link CmsDriverManager#readChangedResourcesInsideProject(CmsDbContext, CmsUUID, CmsReadChangedProjectResourceMode)} * method.<p> */ private static class CmsReadChangedProjectResourceMode { /** * Default constructor.<p> */ protected CmsReadChangedProjectResourceMode() { // noop } }
if (lock.isExclusive()) { if (resource.isFolder()) {
if (lock.isExclusive()) { if (resource.isFolder()) {
if (overwrittenResource == null) { CmsLock lock = getLock(dbc, newResource); if (lock.getEditionLock().isExclusive()) { unlockResource(dbc, newResource, true, false);