package edu.harvard.iq.dataverse.engine;

import edu.harvard.iq.dataverse.authorization.Permission;
import edu.harvard.iq.dataverse.DataFile;
import edu.harvard.iq.dataverse.Dataverse;
import edu.harvard.iq.dataverse.DvObject;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author michael
 */
public class PermissionTest {

    /**
     * Test of appliesTo method, of class Permission.
     */
    @Test
    public void testAppliesTo() {
        assertTrue( Permission.Discover.appliesTo(DvObject.class) );
        assertTrue( Permission.Discover.appliesTo(Dataverse.class) );
        assertTrue( Permission.Discover.appliesTo(DataFile.class) );
        
        assertTrue( Permission.RestrictFile.appliesTo(DataFile.class) );
        assertFalse( Permission.RestrictFile.appliesTo(DvObject.class) );
        assertFalse( Permission.RestrictFile.appliesTo(Dataverse.class) );
    }
    
}

@@ -135,16 +135,57 @@
 taFile;%0A
+import edu.harvard.iq.dataverse.Dataset;%0A
 import e
@@ -500,35 +500,36 @@
 %7B%0A        assert
-Tru
+Fals
 e( Permission.Di
@@ -522,32 +522,37 @@
  Permission.
-Disco
+EditData
 ver
+se
 .appliesTo(D
@@ -596,32 +596,37 @@
  Permission.
-Disco
+EditData
 ver
+se
 .appliesTo(D
@@ -650,35 +650,36 @@
 ;%0A        assert
-Tru
+Fals
 e( Permission.Di
@@ -680,16 +680,21 @@
 ion.
-Disco
+EditData
 ver
+se
 .app
@@ -755,36 +755,35 @@
  Permission.
-RestrictFile
+EditDataset
 .appliesTo(D
@@ -777,36 +777,35 @@
 t.appliesTo(Data
-File
+set
 .class) );%0A     
@@ -827,36 +827,35 @@
  Permission.
-RestrictFile
+EditDataset
 .appliesTo(D
@@ -908,20 +908,19 @@
 ion.
-RestrictFile
+EditDataset
 .app

change tests to test some of the new, simplified permissions