@WithMockUser( username = USERNAME, roles = {ROLE_SU}) @Test void updateSystemEntity() { Attribute currentAttribute = mock(Attribute.class); when(systemEntityTypeRegistry.getSystemAttribute(attributeId)).thenReturn(currentAttribute); assertThrows(SystemMetadataModificationException.class, () -> repo.update(attribute)); }
@Override public void update(Attribute attr) { validateUpdateAllowed(attr); delegate().update(attr); }
AttributeRepositorySecurityDecorator extends AbstractRepositoryDecorator<Attribute> { @Override public void update(Attribute attr) { validateUpdateAllowed(attr); delegate().update(attr); } }
AttributeRepositorySecurityDecorator extends AbstractRepositoryDecorator<Attribute> { @Override public void update(Attribute attr) { validateUpdateAllowed(attr); delegate().update(attr); } AttributeRepositorySecurityDecorator(
      Repository<Attribute> delegateRepository,
      SystemEntityTypeRegistry systemEntityTypeRegistry,
      UserPermissionEvaluator permissionService); }
AttributeRepositorySecurityDecorator extends AbstractRepositoryDecorator<Attribute> { @Override public void update(Attribute attr) { validateUpdateAllowed(attr); delegate().update(attr); } AttributeRepositorySecurityDecorator(
      Repository<Attribute> delegateRepository,
      SystemEntityTypeRegistry systemEntityTypeRegistry,
      UserPermissionEvaluator permissionService); @Override long count(); @Override long count(Query<Attribute> q); @Override Stream<Attribute> findAll(Query<Attribute> q); @Override Iterator<Attribute> iterator(); @Override void forEachBatched(Fetch fetch, Consumer<List<Attribute>> consumer, int batchSize); @Override Attribute findOne(Query<Attribute> q); @Override Attribute findOneById(Object id); @Override Attribute findOneById(Object id, Fetch fetch); @Override Stream<Attribute> findAll(Stream<Object> ids); @Override Stream<Attribute> findAll(Stream<Object> ids, Fetch fetch); @Override AggregateResult aggregate(AggregateQuery aggregateQuery); @Override void update(Attribute attr); @Override void update(Stream<Attribute> attrs); @Override void delete(Attribute attr); @Override void delete(Stream<Attribute> attrs); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(Attribute attr); @Override Integer add(Stream<Attribute> attrs); }
AttributeRepositorySecurityDecorator extends AbstractRepositoryDecorator<Attribute> { @Override public void update(Attribute attr) { validateUpdateAllowed(attr); delegate().update(attr); } AttributeRepositorySecurityDecorator(
      Repository<Attribute> delegateRepository,
      SystemEntityTypeRegistry systemEntityTypeRegistry,
      UserPermissionEvaluator permissionService); @Override long count(); @Override long count(Query<Attribute> q); @Override Stream<Attribute> findAll(Query<Attribute> q); @Override Iterator<Attribute> iterator(); @Override void forEachBatched(Fetch fetch, Consumer<List<Attribute>> consumer, int batchSize); @Override Attribute findOne(Query<Attribute> q); @Override Attribute findOneById(Object id); @Override Attribute findOneById(Object id, Fetch fetch); @Override Stream<Attribute> findAll(Stream<Object> ids); @Override Stream<Attribute> findAll(Stream<Object> ids, Fetch fetch); @Override AggregateResult aggregate(AggregateQuery aggregateQuery); @Override void update(Attribute attr); @Override void update(Stream<Attribute> attrs); @Override void delete(Attribute attr); @Override void delete(Stream<Attribute> attrs); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(Attribute attr); @Override Integer add(Stream<Attribute> attrs);  }