@Test @WithMockUser(username = "user") public void giveUserEntityPermissions() { String entityTypeId = "entityTypeId"; EntityType entityType = when(mock(EntityType.class).getId()).thenReturn(entityTypeId).getMock(); MutableAcl acl = mock(MutableAcl.class); when(mutableAclService.readAclById(new EntityTypeIdentity(entityTypeId))).thenReturn(acl); permissionSystemServiceImpl.giveUserWriteMetaPermissions(entityType); verify(mutableAclService).updateAcl(acl); verify(acl).insertAce(0, PermissionSet.WRITEMETA, new PrincipalSid("user"), true); }
@Override public void giveUserWriteMetaPermissions(EntityType entityType) { giveUserWriteMetaPermissions(singletonList(entityType)); }
PermissionSystemServiceImpl implements PermissionSystemService { @Override public void giveUserWriteMetaPermissions(EntityType entityType) { giveUserWriteMetaPermissions(singletonList(entityType)); } }
PermissionSystemServiceImpl implements PermissionSystemService { @Override public void giveUserWriteMetaPermissions(EntityType entityType) { giveUserWriteMetaPermissions(singletonList(entityType)); } PermissionSystemServiceImpl(MutableAclService mutableAclService); }
PermissionSystemServiceImpl implements PermissionSystemService { @Override public void giveUserWriteMetaPermissions(EntityType entityType) { giveUserWriteMetaPermissions(singletonList(entityType)); } PermissionSystemServiceImpl(MutableAclService mutableAclService); @Override void giveUserWriteMetaPermissions(EntityType entityType); @Override void giveUserWriteMetaPermissions(Collection<EntityType> entityTypes); }
PermissionSystemServiceImpl implements PermissionSystemService { @Override public void giveUserWriteMetaPermissions(EntityType entityType) { giveUserWriteMetaPermissions(singletonList(entityType)); } PermissionSystemServiceImpl(MutableAclService mutableAclService); @Override void giveUserWriteMetaPermissions(EntityType entityType); @Override void giveUserWriteMetaPermissions(Collection<EntityType> entityTypes);  }