protected AllowableActions collectAllowableActions(CmsObject cms, CmsResource file, CmsRelation relation) {

        try {
            Set<Action> aas = new LinkedHashSet<Action>();
            AllowableActionsImpl result = new AllowableActionsImpl();

            CmsLock lock = cms.getLock(file);
            CmsUser user = cms.getRequestContext().getCurrentUser();
            boolean canWrite = !cms.getRequestContext().getCurrentProject().isOnlineProject()
                && (lock.isOwnedBy(user) || lock.isLockableBy(user))
                && cms.hasPermissions(file, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.DEFAULT);
            addAction(aas, Action.CAN_GET_PROPERTIES, true);
            addAction(aas, Action.CAN_DELETE_OBJECT, canWrite && !relation.getType().isDefinedInContent());
            result.setAllowableActions(aas);
            return result;
        } catch (CmsException e) {
            handleCmsException(e);
            return null;
        }
    }
protected AllowableActions collectAllowableActions ( CmsObject cms , CmsResource file , CmsRelation relation ) { try { Set < Action > aas = new LinkedHashSet < Action > ( ) ; AllowableActionsImpl result = new AllowableActionsImpl ( ) ; CmsLock lock = cms . getLock ( file ) ; CmsUser user = cms . getRequestContext ( ) . getCurrentUser ( ) ; boolean canWrite = ! cms . getRequestContext ( ) . getCurrentProject ( ) . isOnlineProject ( ) && ( lock . isOwnedBy ( user ) || lock . isLockableBy ( user ) ) && cms . hasPermissions ( file , CmsPermissionSet . ACCESS_WRITE , false , CmsResourceFilter . DEFAULT ) ; addAction ( aas , Action . CAN_GET_PROPERTIES , true ) ; addAction ( aas , Action . CAN_DELETE_OBJECT , canWrite && ! relation . getType ( ) . isDefinedInContent ( ) ) ; result . setAllowableActions ( aas ) ; return result ; } catch ( CmsException e ) { handleCmsException ( e ) ; return null ; } }
Collects the allowable actions for a relation.<p>

@param cms the current CMS context
@param file the source of the relation
@param relation the relation object

@return the allowable actions for the given resource