How to restrict users from deleting a file + How to get back a deleted file?
Hi,
#1 - Is there a way to restrict users from being able to delete ANY files in component? I checked the "team configuration > Permissions" and it didn't have any.
#2 - Also, a user deleted a file and he doesn't recollect which component or workitem he used while deleting it. Is there a way to get this file back?
Please let me know.
|
2 answers
1. I don't think you can prevent the users to delete a file and check-in from his workspace, but you can prevent him deliver that change set to the stream by using "Restrict Changes by Item Name" pre-condition in "Deliver Phase 2 (server)" operation behavior.
2. To restore the file, you have to know from which component and change set you made the deletion, then discard or reverse the change set. |
Ralph Schoon (63.5k●3●36●46)
| answered Nov 03 '15, 2:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
This advisor code would be able to prevent delivery of deletions. It is from somewhere in the wiki.
You can search for deletions. In general I do think that deletion is common enough that people should be allowed to do them.
/******************************************************************************* * Licensed Materials - Property of IBM (c) Copyright IBM Corporation 2005-2012. * All Rights Reserved. * * Note to U.S. Government Users Restricted Rights: Use, duplication or * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ******************************************************************************/ package advisor.example; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; import com.ibm.team.process.common.IProcessConfigurationElement; import com.ibm.team.process.common.advice.AdvisableOperation; import com.ibm.team.process.common.advice.IAdvisorInfo; import com.ibm.team.process.common.advice.IAdvisorInfoCollector; import com.ibm.team.process.common.advice.runtime.IOperationAdvisor; import com.ibm.team.repository.common.IItemHandle; import com.ibm.team.repository.common.TeamRepositoryException; import com.ibm.team.repository.service.AbstractService; import com.ibm.team.repository.service.IItemServiceIterator; import com.ibm.team.repository.service.IRepositoryItemService; import com.ibm.team.repository.service.ItemServiceIteratorFactory; import com.ibm.team.scm.common.IChange; import com.ibm.team.scm.common.IChangeSet; import com.ibm.team.scm.common.IChangeSetHandle; import com.ibm.team.scm.common.IScmService; import com.ibm.team.scm.common.IVersionable; import com.ibm.team.scm.common.IVersionableHandle; import com.ibm.team.scm.common.dto.IAncestorReport; import com.ibm.team.scm.common.dto.INameItemPair; import com.ibm.team.scm.common.internal.dto.ServiceConfigurationProvider; import com.ibm.team.scm.common.process.DeliverOperationData; @SuppressWarnings("unchecked") public class RestrictDeliverOfDeletionsAdvisor extends AbstractService implements IOperationAdvisor { public void run(AdvisableOperation operation, IProcessConfigurationElement advisorConfiguration, IAdvisorInfoCollector collector, IProgressMonitor monitor) throws TeamRepositoryException { Object operationData = operation.getOperationData(); if (!(operationData instanceof DeliverOperationData)) { return; } DeliverOperationData data = (DeliverOperationData) operationData; List |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.