@Test void testAddType() { setSu(); permissionServiceDecorator.addType("entity-typeId"); verify(permissionService).addType("entity-typeId"); resetContext(); }
@Override public void addType(String typeId) { if (SecurityUtils.currentUserIsSuOrSystem()) { permissionService.addType(typeId); } else { throw new InsufficientPermissionsException( "type", typeId, Collections.singletonList(SUPERUSER)); } }
PermissionServiceDecorator implements PermissionService { @Override public void addType(String typeId) { if (SecurityUtils.currentUserIsSuOrSystem()) { permissionService.addType(typeId); } else { throw new InsufficientPermissionsException( "type", typeId, Collections.singletonList(SUPERUSER)); } } }
PermissionServiceDecorator implements PermissionService { @Override public void addType(String typeId) { if (SecurityUtils.currentUserIsSuOrSystem()) { permissionService.addType(typeId); } else { throw new InsufficientPermissionsException( "type", typeId, Collections.singletonList(SUPERUSER)); } } PermissionServiceDecorator(
      PermissionService permissionService,
      EntityHelper entityHelper,
      UserRoleTools userRoleTools,
      MutableAclService mutableAclService,
      MutableAclClassService mutableAclClassService,
      UserPermissionEvaluator userPermissionEvaluator); }
PermissionServiceDecorator implements PermissionService { @Override public void addType(String typeId) { if (SecurityUtils.currentUserIsSuOrSystem()) { permissionService.addType(typeId); } else { throw new InsufficientPermissionsException( "type", typeId, Collections.singletonList(SUPERUSER)); } } PermissionServiceDecorator(
      PermissionService permissionService,
      EntityHelper entityHelper,
      UserRoleTools userRoleTools,
      MutableAclService mutableAclService,
      MutableAclClassService mutableAclClassService,
      UserPermissionEvaluator userPermissionEvaluator); @Override Set<LabelledType> getLabelledTypes(); @Override Set<LabelledPermission> getPermissionsForObject(
      ObjectIdentity objectIdentity, Set<Sid> sids, boolean isReturnInheritedPermissions); @Override void createAcl(ObjectIdentity objectIdentity); @Override void createPermission(Permission permission); @Override void createPermissions(Set<Permission> permissions); @Override void updatePermission(Permission permission); @Override void updatePermissions(Set<Permission> permissions); @Override void deletePermission(Sid sid, ObjectIdentity objectIdentity); @Override void addType(String typeId); @Override void deleteType(String typeId); @Override Map<String, Set<LabelledPermission>> getPermissionsForType(
      String typeId, Set<Sid> sids, boolean isReturnInherited); @Override Map<String, Set<LabelledPermission>> getPermissionsForType(
      String typeId, Set<Sid> sids, int page, int pageSize); @Override Set<LabelledPermission> getPermissions(Set<Sid> sids, boolean isReturnInherited); @Override Set<LabelledObject> getObjects(String typeId, int page, int pageSize); @Override Set<PermissionSet> getSuitablePermissionsForType(String typeId); @Override boolean exists(ObjectIdentity objectIdentity, Sid sid); }
PermissionServiceDecorator implements PermissionService { @Override public void addType(String typeId) { if (SecurityUtils.currentUserIsSuOrSystem()) { permissionService.addType(typeId); } else { throw new InsufficientPermissionsException( "type", typeId, Collections.singletonList(SUPERUSER)); } } PermissionServiceDecorator(
      PermissionService permissionService,
      EntityHelper entityHelper,
      UserRoleTools userRoleTools,
      MutableAclService mutableAclService,
      MutableAclClassService mutableAclClassService,
      UserPermissionEvaluator userPermissionEvaluator); @Override Set<LabelledType> getLabelledTypes(); @Override Set<LabelledPermission> getPermissionsForObject(
      ObjectIdentity objectIdentity, Set<Sid> sids, boolean isReturnInheritedPermissions); @Override void createAcl(ObjectIdentity objectIdentity); @Override void createPermission(Permission permission); @Override void createPermissions(Set<Permission> permissions); @Override void updatePermission(Permission permission); @Override void updatePermissions(Set<Permission> permissions); @Override void deletePermission(Sid sid, ObjectIdentity objectIdentity); @Override void addType(String typeId); @Override void deleteType(String typeId); @Override Map<String, Set<LabelledPermission>> getPermissionsForType(
      String typeId, Set<Sid> sids, boolean isReturnInherited); @Override Map<String, Set<LabelledPermission>> getPermissionsForType(
      String typeId, Set<Sid> sids, int page, int pageSize); @Override Set<LabelledPermission> getPermissions(Set<Sid> sids, boolean isReturnInherited); @Override Set<LabelledObject> getObjects(String typeId, int page, int pageSize); @Override Set<PermissionSet> getSuitablePermissionsForType(String typeId); @Override boolean exists(ObjectIdentity objectIdentity, Sid sid); static final String SUPERUSER; }