@Test
public void testSetPermissions() {

    metadata.commit(() -> {
        createRole("feedEditor", "Editor", "Can edit feeds", FeedAccessControl.ACCESS_FEED);
    }, MetadataAccess.SERVICE);
    metadata.commit(() -> {
        Optional<SecurityRole> option = this.provider.getRole(SecurityRole.FEED, "feedEditor");
        
        assertThat(option.get().getAllowedActions().getAvailableActions().stream().flatMap(action -> action.stream()))
            .extracting("systemName")
            .contains(FeedAccessControl.ACCESS_FEED.getSystemName())
            .doesNotContain(FeedAccessControl.EDIT_DETAILS.getSystemName());
        
        this.provider.setPermissions(SecurityRole.FEED, "feedEditor", FeedAccessControl.EDIT_DETAILS, FeedAccessControl.EXPORT);
    }, MetadataAccess.SERVICE);
    
    metadata.read(() -> {
        Optional<SecurityRole> option = this.provider.getRole(SecurityRole.FEED, "feedEditor");
        
        assertThat(option.get().getAllowedActions().getAvailableActions().stream().flatMap(action -> action.stream()))
            .extracting("systemName")
            .contains(FeedAccessControl.ACCESS_FEED.getSystemName(),
                      FeedAccessControl.ACCESS_DETAILS.getSystemName(), 
                      FeedAccessControl.EDIT_DETAILS.getSystemName(), 
                      FeedAccessControl.EXPORT.getSystemName())
            .doesNotContain(FeedAccessControl.ENABLE_DISABLE.getSystemName());
    }, MetadataAccess.SERVICE);
    
}