I want to revoke some permission from a user in a space but not able to find a way that works .
1. when iam trying with removeallpermission then all the access of user is revoked , sometime the user is deleted from his own space .
2)I have tried
SpacePermission spacePermission = SpacePermission.createUserSpacePermission(SpacePermission.EXPORT_SPACE_PERMISSION,space,user);
spacePermissionManager.removePermission(spacePermission);
but this is also not working and making no change in permissions.