-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #462 from dcrissman/issue458
fixes #458 - change all access levels to anyone
- Loading branch information
Showing
3 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
test/src/test/java/com/redhat/lightblue/test/AbstractCRUDTestControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.redhat.lightblue.test; | ||
|
||
import static com.redhat.lightblue.util.test.AbstractJsonNodeTest.loadJsonNode; | ||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
public class AbstractCRUDTestControllerTest { | ||
|
||
@Test | ||
public void testGrantAnyoneAccess() throws Exception { | ||
JsonNode node = loadJsonNode("./metadata/access.json"); | ||
AbstractCRUDTestController.grantAnyoneAccess(node); | ||
|
||
assertEquals("anyone", | ||
node.get("schema").get("access").get("insert").get(0).textValue()); | ||
assertEquals("anyone", | ||
node.get("schema").get("fields").get("anArray").get("access").get("insert").get(0).textValue()); | ||
assertEquals("anyone", | ||
node.get("schema").get("fields").get("anArray").get("items").get("fields").get("name").get("access").get("insert").get(0).textValue()); | ||
assertEquals("anyone", | ||
node.get("schema").get("fields").get("someField").get("access").get("insert").get(0).textValue()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"schema": { | ||
"access": { | ||
"insert": [ | ||
"insert-perm" | ||
], | ||
"update": [ | ||
"update-perm" | ||
], | ||
"find": [ | ||
"find-perm" | ||
], | ||
"delete": [ | ||
"delete-perm" | ||
] | ||
}, | ||
"fields": { | ||
"anArray": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"fields": { | ||
"name": { | ||
"type": "string", | ||
"access": { | ||
"insert": [ | ||
"insert-perm" | ||
], | ||
"update": [ | ||
"update-perm" | ||
], | ||
"find": [ | ||
"find-perm" | ||
], | ||
"delete": [ | ||
"delete-perm" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"access": { | ||
"insert": [ | ||
"insert-perm" | ||
], | ||
"update": [ | ||
"update-perm" | ||
], | ||
"find": [ | ||
"find-perm" | ||
], | ||
"delete": [ | ||
"delete-perm" | ||
] | ||
} | ||
}, | ||
"someField": { | ||
"type": "string", | ||
"access": { | ||
"insert": [ | ||
"insert-perm" | ||
], | ||
"update": [ | ||
"update-perm" | ||
], | ||
"find": [ | ||
"find-perm" | ||
], | ||
"delete": [ | ||
"delete-perm" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |