Ignore:
Timestamp:
Apr 5, 2011, 12:10:29 PM (12 years ago)
Author:
robert@…
Message:

Small fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/nl/tno/metagenomics/Run.groovy

    r9 r26  
    11package nl.tno.metagenomics
    22
     3import nl.tno.metagenomics.auth.User
    34import org.codehaus.groovy.grails.commons.ConfigurationHolder
    45
     
    112113                return list.unique().toList();
    113114        }
     115       
     116        /**
     117         * Returns true if this run can be deleted
     118         *
     119         * @return
     120         */
     121        public boolean deletable( User u ) {
     122                // Don't remove runs for which data exists
     123                if( this.assaySamples*.sequenceData.flatten().size() ) {
     124                        return false;
     125                }
     126
     127                // Check whether the user has sufficient privileges to remove the run from all assays
     128                def hasPrivileges = true;
     129                assays.each {
     130                        if( !it.study.canWrite( u ) )
     131                                hasPrivileges = false
     132                }
     133               
     134                return hasPrivileges
     135        }
    114136}
Note: See TracChangeset for help on using the changeset viewer.