@WithMockUser( username = "USER", authorities = {"ROLE_SU"}) @Test void hasPermissionSetOnPluginSuperuser() { assertTrue( userPermissionEvaluator.hasPermission( new PluginIdentity("plugin1"), EntityTypePermission.READ_DATA)); }
@Override public boolean hasPermission(ObjectIdentity objectIdentity, Permission action) { if (SecurityUtils.currentUserIsSuOrSystem()) { return true; } else { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && permissionEvaluator.hasPermission( authentication, objectIdentity.getIdentifier(), objectIdentity.getType(), getCumulativePermissionToCheck(action)); } }
UserPermissionEvaluatorImpl implements UserPermissionEvaluator { @Override public boolean hasPermission(ObjectIdentity objectIdentity, Permission action) { if (SecurityUtils.currentUserIsSuOrSystem()) { return true; } else { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && permissionEvaluator.hasPermission( authentication, objectIdentity.getIdentifier(), objectIdentity.getType(), getCumulativePermissionToCheck(action)); } } }
UserPermissionEvaluatorImpl implements UserPermissionEvaluator { @Override public boolean hasPermission(ObjectIdentity objectIdentity, Permission action) { if (SecurityUtils.currentUserIsSuOrSystem()) { return true; } else { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && permissionEvaluator.hasPermission( authentication, objectIdentity.getIdentifier(), objectIdentity.getType(), getCumulativePermissionToCheck(action)); } } UserPermissionEvaluatorImpl(
      PermissionEvaluator permissionEvaluator, PermissionRegistry permissionRegistry); }
UserPermissionEvaluatorImpl implements UserPermissionEvaluator { @Override public boolean hasPermission(ObjectIdentity objectIdentity, Permission action) { if (SecurityUtils.currentUserIsSuOrSystem()) { return true; } else { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && permissionEvaluator.hasPermission( authentication, objectIdentity.getIdentifier(), objectIdentity.getType(), getCumulativePermissionToCheck(action)); } } UserPermissionEvaluatorImpl(
      PermissionEvaluator permissionEvaluator, PermissionRegistry permissionRegistry); @Override boolean hasPermission(ObjectIdentity objectIdentity, Permission action); @Override boolean hasPermission(ObjectIdentity objectIdentity, List<Permission> permissions); @Override Set<Permission> getPermissions(ObjectIdentity objectIdentity, Permission[] permissions); }
UserPermissionEvaluatorImpl implements UserPermissionEvaluator { @Override public boolean hasPermission(ObjectIdentity objectIdentity, Permission action) { if (SecurityUtils.currentUserIsSuOrSystem()) { return true; } else { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && permissionEvaluator.hasPermission( authentication, objectIdentity.getIdentifier(), objectIdentity.getType(), getCumulativePermissionToCheck(action)); } } UserPermissionEvaluatorImpl(
      PermissionEvaluator permissionEvaluator, PermissionRegistry permissionRegistry); @Override boolean hasPermission(ObjectIdentity objectIdentity, Permission action); @Override boolean hasPermission(ObjectIdentity objectIdentity, List<Permission> permissions); @Override Set<Permission> getPermissions(ObjectIdentity objectIdentity, Permission[] permissions);  }